void DataChangeHandler(ApplicationData appData, object args) { if (_roamingSettingsService.ContainsKey(Key)) { var hex = _roamingSettingsService.GetData(Key).ToString(); Current = Accents.First(c => c.Hex.Equals(hex)); } }
private void LoadSettings() { var settings = Serializer.Load <Settings>(GetFileName("Settings.xml")); string accentName = null; if (settings != null) { accentName = settings.AccentName; Application.Current.MainWindow.Topmost = settings.IsAlwaysOnTop; } _settings = settings ?? new Settings(); if (accentName == null) { accentName = "Cobalt"; } ChangeAccentCommand.Execute(Accents.First(acc => acc.Name == accentName)); }
private void LoadAccents() { _accents = new ObservableCollection <Accent> { new Accent { Name = "Blue", Hex = "#1BA1E2" }, new Accent { Name = "Brown", Hex = "#A05000" }, new Accent { Name = "Green", Hex = "#339933" }, new Accent { Name = "Pink", Hex = "#E671B8" }, new Accent { Name = "Purple", Hex = "#A200FF" }, new Accent { Name = "Red", Hex = "#E51400" }, new Accent { Name = "Teal", Hex = "#00ABA9" }, new Accent { Name = "Lime", Hex = "#A2C139 " }, new Accent { Name = "Magenta", Hex = "#D80073 " } }; if (_roamingSettingsService.ContainsKey(Key)) { var hex = _roamingSettingsService.GetData(Key).ToString(); Current = Accents.First(c => c.Hex.Equals(hex)); } else { Current = Accents.First(); } }
public MainViewModel(bool main, IWindow window) { IsMain = main; Window = window; AppManager = AppManager.Instance; DebugManager = AppManager.Debug; UIManager = AppManager.UI; UIManager.Windows.Add(this); if (IsMain) { var commandView = AppManager.Container.GetExportedValue <CommandViewModel>(); AddItem(commandView); } CurrentAccent = Accents.First(accent => accent.Name == "Cobalt"); DebugManager.Debugger.StatusChanged += Debugger_StatusChanged; }