public bool Load() { if (File.Exists(settingsFile)) { var content = File.ReadAllText(settingsFile); var settings = JsonConvert.DeserializeObject <ShellSettings>(content); Theme = settings.Theme; MainWindowSetting = settings.MainWindowSetting; ThemeType theme; if (Enum.TryParse(Theme.Name, out theme)) { UpdateTheme(theme); } if (!string.IsNullOrWhiteSpace(settings.Theme.BackgroundVideo)) { var file = ThemeManager.GetVideoFile(settings.Theme.BackgroundVideo); if (file.Exists) { ThemeManager.SetBackgroundVideo(file.FullName); } } return(true); } return(false); }
public ShellSettings() { Theme = new ShellTheme(); MainWindowSetting = new ShellMainWindowSetting(); }