public static T GetValue <T>(this UserControl self, DependencyProperty dp) { return((T)self.GetValue(dp)); }
/// <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); }