/// <summary> /// Called when the toolbar overflow button is unchecked. /// </summary> /// <param name="sender">The button object.</param> /// <param name="e">This parameter is not used.</param> protected virtual void OnOverflowButtonUnchecked(object sender, RoutedEventArgs e) { if (sender is ToggleButton OverflowButton) { if (OverflowButton.Parent is FrameworkElement ParentControl) { if (ParentControl.FindName("AddRemoveButton") is ToggleButton AddRemoveButton) { AddRemoveButton.IsChecked = false; AddRemoveButton.IsEnabled = true; } } } }
/// <summary> /// Called when the toolbar overflow button is unchecked. /// </summary> /// <param name="sender">The button object</param> /// <param name="e">This parameter is not used</param> protected virtual void OnOverflowButtonUnchecked(object sender, RoutedEventArgs e) { ToggleButton OverflowButton; if ((OverflowButton = sender as ToggleButton) != null) { FrameworkElement ParentControl; if ((ParentControl = OverflowButton.Parent as FrameworkElement) != null) { ToggleButton AddRemoveButton; if ((AddRemoveButton = ParentControl.FindName("AddRemoveButton") as ToggleButton) != null) { AddRemoveButton.IsChecked = false; AddRemoveButton.IsEnabled = true; } } } }