/// <summary> /// Instantiation of MainWindowViewModel /// </summary> public MainWindowViewModel() { s_Instance = this; Model = new MainWindowModel(); AddAccent("BaseAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/BaseAccent.xaml")); AddTheme(new LightTheme()); AddTheme(new DarkTheme()); SetTheme(Properties.Settings.Default.Theme); SetAccent("BaseAccent"); DockManager = new DockManagerViewModel(Properties.Settings.Default.OpenDocuments); SettingsMenu = new SettingsMenuViewModel(); RuntimeItems = new ObservableCollection <ComboBoxItem>(); if (MacroUI.GetInstance().IsLoaded()) { Initialize(); } else { Events.SubscribeEvent("ApplicationLoaded", (Action)Initialize); } Events.SubscribeEvent("ActiveMacroChanged", (Action)ActiveMacroChanged); }
/// <summary> /// Instantiation of SettingsMenuViewModel /// </summary> public SettingsMenuViewModel() { s_Instance = this; Model = new SettingsMenuModel(); Events.SubscribeEvent("ThemeChanged", (Action)ThemeChanged); //Routing.EventManager.ThemeChangedEvent += ThemeChanged; PreviousTheme = MainWindowViewModel.GetInstance().ActiveTheme.Name; LoadColors(); //Events.OnAssembliesChanged += LoadAssemblies; Events.SubscribeEvent("OnAssembliesChanged", (Action)LoadAssemblies); LoadAssemblies(); }