public static void IsExpandedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { OdcExpander expander = d as OdcExpander; RoutedEventArgs args = new RoutedEventArgs((bool)e.NewValue ? ExpandedEvent : CollapsedEvent); expander.RaiseEvent(args); }
public static void OnMinimizedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { bool minimized = (bool)e.NewValue; OdcExpander expander = d as OdcExpander; RoutedEventArgs args = new RoutedEventArgs(minimized ? MinimizedEvent : MaximizedEvent); expander.IsEnabled = !minimized; expander.RaiseEvent(args); }