Exemplo n.º 1
0
 public static T GetValue <T>(this UserControl self, DependencyProperty dp)
 {
     return((T)self.GetValue(dp));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the view model instance attached to the specified control.
 /// </summary>
 /// <param name="userControl">The control to lookup.</param>
 /// <returns>The view model if one is associated with the control; null otherwise.</returns>
 public static object GetViewModel(UserControl userControl)
 {
     return userControl.GetValue(ViewModelProperty);
 }