public void UpdateBrushes() { bool selected = (bdrBar.Background == SelectedBrush); SelectedBrush = (SolidColorBrush)FindResource("SelectedBrush"); UnselectedBrush = (SolidColorBrush)FindResource("UnselectedBrush"); bdrBar.Background = selected ? SelectedBrush : UnselectedBrush; if (rp != null) { rp.UpdateBrushes(); } if (GroupList != null) { GroupList.UpdateBrushes(); } }
private void ButtonBase_Click(object sender, RoutedEventArgs e) { ButtonBase button = e.OriginalSource as ButtonBase; if (button == null || e.Handled) { return; } switch (button.Name) { case "btnNew": New(); break; case "btnOpen": Open(); break; case "btnSave": Save(); break; case "btnSaveAs": SaveAs(); break; case "btnAdd": gridAdd.Visibility = Visibility.Visible; break; case "btnAddClose": case "btnAddFinished": gridAdd.Visibility = Visibility.Hidden; break; case "btnDelete": DeleteSelectedItems(); break; case "btnGroup": GroupSelectedItems(); break; case "btnUngroup": UngroupSelectedGroup(); break; case "btnCut": Cut(); break; case "btnCopy": Copy(); break; case "btnPaste": Paste(); break; case "btnLight": //((App)Application.Current).SetSkin("Light"); BlockList.UpdateBrushes(); btnLight.IsEnabled = false; btnDark.IsEnabled = true; break; case "btnDark": //((App)Application.Current).SetSkin("Dark"); BlockList.UpdateBrushes(); btnLight.IsEnabled = true; btnDark.IsEnabled = false; break; case "btnAbout": MessageBox.Show("Created by Bruce Greene\nwww.MotionCommander.com", "Block Editor", MessageBoxButton.OK, MessageBoxImage.Information); break; //case "btnMinimize": WindowState = WindowState.Minimized; break; case "btnMaximize": ToggleMaximized(); break; //case "btnClose": Close(); break; } }