public SettingsWindowViewmodel(MainWindow main, AppSettings data) { mainWindow = main; Settings = data; ShortcutList = ShortcutManager.ListObservableShortcuts(data); AvailableThemes = App.Themes.GetAllAvailableThemes(); AvailableModifier = App.Themes.GetAllAvailableModifier().Select(m => new CheckableAlephTheme { Theme = m, Owner = this, Checked = data.ThemeModifier.Contains(m.SourceFilename) }).ToList(); _selectedTheme = App.Themes.GetThemeByFilename(Settings.Theme, out _) ?? App.Themes.GetDefault() ?? AvailableThemes.FirstOrDefault() ?? App.Themes.GetFallback(); _oldTheme = ThemeManager.Inst.CurrentBaseTheme; _oldModifiers = ThemeManager.Inst.CurrentModifers.ToList(); SnippetList = new ObservableCollectionNoReset <EditableSnippet>(data.Snippets.Data.Select(p => new EditableSnippet { PreviewFunc = SnippetPrev, ID = p.Key, Name = p.Value.DisplayName, Value = p.Value.Value })); NewSnippetID = GetNextSnippetID(); }
public SettingsWindowViewmodel(MainWindow main, AppSettings data) { mainWindow = main; Settings = data; ShortcutList = ShortcutManager.ListObservableShortcuts(data); AvailableThemes = App.Themes.GetAllAvailable(); _selectedTheme = App.Themes.GetByFilename(Settings.Theme, out _) ?? App.Themes.GetByFilename("default.xml", out _) ?? AvailableThemes.FirstOrDefault() ?? App.Themes.GetFallback(); }