private void ChangeThemeButton_Click(object sender, RoutedEventArgs e) { themeIndex = (themeIndex + 1) % presetComboBox.Items.Count; PresetItem item = presetComboBox.Items[themeIndex] as PresetItem; setToConfigFile(); if (item != null) { Style viewStyle = null; if (item.ResourceDictionary != null) { viewStyle = (Style)item.ResourceDictionary[typeof(Xceed.Wpf.DataGrid.Views.CardflowView3D)]; } this.presetComboBox.SelectedItem = null; ViewImportExportManager.ImportViewFromStyle(this.grid.View, viewStyle); } }
public void init(string id) { string[] str = id.Split(' '); name = str.First <string>() + "_" + str.Last <string>(); // name setted now grid.Background = ((DictionaryEntry)GridBackgroundBrush.Items[backIndex]).Value as Brush; PresetItem item = presetComboBox.Items[themeIndex] as PresetItem; if (item != null) { Style viewStyle = null; if (item.ResourceDictionary != null) { viewStyle = (Style)item.ResourceDictionary[typeof(Xceed.Wpf.DataGrid.Views.CardflowView3D)]; } this.presetComboBox.SelectedItem = null; ViewImportExportManager.ImportViewFromStyle(this.grid.View, viewStyle); } }