コード例 #1
0
        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>();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: MainViewModel.cs プロジェクト: krisrang/youdown-old
        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;
        }