/// <summary> /// IsNonExpandableProperty changed handler. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void OnIsNonExpandablePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { ExpanderView source = (ExpanderView)obj; if ((bool)e.NewValue) { if (source.IsExpanded) { source.IsExpanded = false; } } source.UpdateVisualState(true); }
/// <summary> /// IsExpandedProperty changed handler. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void OnIsExpandedPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { ExpanderView source = (ExpanderView)obj; RoutedEventArgs args = new RoutedEventArgs(); if ((bool)e.NewValue) { source.OnExpanded(args); } else { source.OnCollapsed(args); } source.UpdateVisualState(true); }
/// <summary> /// NonExpandableHeaderTemplate changed handler. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void OnNonExpandableHeaderTemplatePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { ExpanderView source = (ExpanderView)obj; source.OnNonExpandableHeaderTemplateChanged((DataTemplate)e.OldValue, (DataTemplate)e.NewValue); }
/// <summary> /// ExpanderProperty changed handler. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void OnExpanderPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { ExpanderView source = (ExpanderView)obj; source.OnExpanderChanged(e.OldValue, e.NewValue); }