/// <summary> /// IsEnabledProperty property changed handler. /// </summary> /// <param name="d">ContentControl that changed IsEnabled.</param> /// <param name="e">DependencyPropertyChangedEventArgs.</param> private static void OnIsEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ContentControl source = d as ContentControl; Debug.Assert(source != null, "The source is not an instance of ContentControl!"); Debug.Assert(typeof(bool).IsInstanceOfType(e.NewValue), "The value is not an instance of bool!"); bool value = (bool)e.NewValue; source.OnIsEnabledChanged(value); }