public ViewModel() { _applicationStateModel = new ApplicationStateModel(); _configurationManager = new ConfigurationManager(); _configurationModel = _configurationManager.Load(); if (_configurationModel.PresetCollection.Count == 0) { _configurationModel.PresetCollection.Add(new Preset() { Name = "New Preset" }); } _openFileManager = new OpenFileManager(); _soundManager = new SoundManager(_configurationModel); _shortcutManager = new ShortcutManager(_applicationStateModel, _configurationModel, _soundManager); _updateManager = new UpdateManager(); _presetConfigurationViewModel = new PresetConfigurationViewModel(_applicationStateModel, _configurationModel); _multiSoundViewModel = new MultiSoundViewModel(_applicationStateModel, _configurationModel); _configurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender); _configurationModel.CounterShortcuts.Next.Command = NextCounterCommand; _configurationModel.CounterShortcuts.Previous.Command = PreviousCounterCommand; _configurationModel.CounterShortcuts.Increment.Command = IncrementCommand; _configurationModel.CounterShortcuts.Decrement.Command = DecrementCommand; _configurationModel.CounterShortcuts.Reset.Command = ResetCommand; _configurationModel.SoundShortcuts.Pause.Command = PauseCommand; _configurationModel.SoundShortcuts.Continue.Command = ContinueCommand; _configurationModel.SoundShortcuts.Stop.Command = StopCommand; Task.Run(() => _updateManager.AutoUpdateCheck(Version)); }
private void MultiAddSounds() { _multiSoundViewModel = new MultiSoundViewModel(_applicationStateModel, _configurationModel); _applicationStateModel.MultiSoundOpened = true; }