Пример #1
0
        public MainWindowViewModel(VideoPlayer videoPlayerIn)
        {
            this.exportQueueViewModel = new ExportQueueViewModel();

            OpenFileCommand               = new OpenFileCommand(this, videoPlayerIn);
            OpenExportQueueCommand        = new OpenExportQueueCommand(this, this.exportQueueViewModel);
            OpenSettingsCommand           = new OpenSettingsCommand(this);
            OpenAboutCommand              = new OpenAboutCommand(this);
            PlayOrPauseCommand            = new PlayOrPauseCommand(this, videoPlayerIn);
            SetSectionStartCommand        = new SetSectionStartCommand(this, videoPlayerIn);
            SetSectionEndCommand          = new SetSectionEndCommand(this, videoPlayerIn);
            BackwardCommand               = new BackwardCommand(this, videoPlayerIn);
            ForwardCommand                = new ForwardCommand(this, videoPlayerIn);
            StepBackwardCommand           = new SeekCommand(this, videoPlayerIn, () => - videoPlayerIn.FrameTime);
            StepForwardCommand            = new SeekCommand(this, videoPlayerIn, () => videoPlayerIn.FrameTime);
            Step1sBackwardCommand         = new SeekCommand(this, videoPlayerIn, () => - TimeSpan.FromSeconds(1));
            Step1sForwardCommand          = new SeekCommand(this, videoPlayerIn, () => TimeSpan.FromSeconds(1));
            PlayFromSelectionStartCommand = new PlayFromSelectionStartCommand(this, videoPlayerIn);
            PlaySelectionCommand          = new PlaySelectionCommand(this, videoPlayerIn);
            PlayUntilSelectionEndCommand  = new PlayUntilSelectionEndCommand(this, videoPlayerIn);
            ExportSelectionCommand        = new ExportSelectionCommand(this);
            NextVideoCommand              = new NextVideoCommand(this, videoPlayerIn);
            AddToQueueCommand             = new AddToQueueCommand(this, this.exportQueueViewModel);

            AudioVolume = ApplicationSettings.AudioVolume;
        }
Пример #2
0
        private async Task <bool> AddToQueue()
        {
            var canExecute = AddToQueueCommand.CanExecute();

            if (canExecute)
            {
                /* await */ AddToQueueCommand.Execute();
            }

            return(canExecute);
        }
Пример #3
0
 private void RaiseExecuteChangedForAddButtons()
 {
     GeneralSearchCommand.RaiseCanExecuteChanged();
     AddToQueueCommand.RaiseCanExecuteChanged();
 }