public DownloadViewModel(IMessageBox messageBox, IMediator mediator, SettingsManager settingsManager) { _messageBox = messageBox; _mediator = mediator; _settingsManager = settingsManager; _mediator.Register(this); UIEnabled = true; SelectedQuality = QualityList.FirstOrDefault(q => q.Id == _settingsManager.Settings.MaxQuality) ?? QualityList[0]; TargetPath = _settingsManager.Settings.TargetPath; AddCommand = new DelegateCommand(ExecuteAddCommand); TargetCommand = new DelegateCommand(ExecuteTargetCommand); GoCommand = new DelegateCommand(ExecuteGoCommand); StopCommand = new DelegateCommand(ExecuteStopCommand); ImportCommand = new DelegateCommand(ExecuteImportCommand); Queue = new VideoQueue(); Queue.TotalProgressChanged += TotalProgressChanged; Queue.QueueStateChanged += QueueStateChanged; Queue.VideoFinished += VideoFinished; FinishedVideos = new ObservableCollection<Video>(); }
public SettingsViewModel(IMediator mediator, SettingsManager settingsManager) { _mediator = mediator; _settingsManager = settingsManager; _oldSettings = _settingsManager.Settings.Clone(); UpdateCommand = new DelegateCommand(ExecuteUpdateCommand); SaveCommand = new DelegateCommand(ExecuteSaveCommand); CloseCommand = new DelegateCommand(ExecuteCloseCommand); }
public MainViewModel(IContainerStatus containerStatus, IMediator mediator, SettingsManager settingsManager) { _settingsManager = settingsManager; mediator.Register(this); SettingsCommand = new DelegateCommand(ExecuteSettingsCommand); if (_settingsManager.Settings.CheckUpdatesOnLaunch) containerStatus.ContainerLoaded += () => UpdateCheck(true); ScreenChangeVisible = true; }