/// <summary> /// Called when the active button is changed. /// </summary> /// <param name="sender">The event source.</param> /// <param name="e">The event data.</param> protected virtual void OnIsActiveChanged(object sender, RoutedEventArgs e) { FrameworkElement?Element = sender as FrameworkElement; while (Element != null) { if (Element is ToolBarTray AsToolBarTray) { PrettyItemsControl.MakeToolBarTrayPretty(AsToolBarTray); break; } Element = Element.Parent as FrameworkElement; } }
/// <summary> /// Called when the main toolbar is loaded. /// </summary> /// <param name="sender">The event source.</param> /// <param name="e">The event data.</param> private void OnMainToolBarLoaded(object sender, RoutedEventArgs e) { NotifyMainToolBarLoaded(e); PrettyItemsControl.MakeToolBarTrayPretty((ToolBarTray)sender); }