private void menuItemDarkTheme_Click(object sender, RoutedEventArgs e) { try { WindowItemVM WindowItemVM = (WindowItemVM)DataContext; if (WindowItemVM != null) { WindowInfoVM windowInfoVM = WindowItemVM.WindowInfoVM; if (windowInfoVM != null) { Themes.DarkTheme(windowInfoVM); SaveData.SaveShortcuts(false); } } } catch (Exception ex) { Error.ShowDialog(ex); } }