Example #1
0
        private void InvalidateCommandMenus()
        {
            var playbackCommands = this.ServiceProvider.GetRequiredService <PlaybackCommands>();

            this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipFastBackwardVideoCommand));
            this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipBackwardCommand));
            this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.TogglePlayStateCommand));
            this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipForwardCommand));
            this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipFastForwardVideoCommand));


            var comboBox = new ComboBox
            {
                SelectedValuePath = "Key",
                DisplayMemberPath = "Value"
            };

            comboBox.Items.Add(new KeyValuePair <double, string>(0.25, "0.25"));
            comboBox.Items.Add(new KeyValuePair <double, string>(0.5, "0.5"));
            comboBox.Items.Add(new KeyValuePair <double, string>(0.75, "0.75"));
            comboBox.Items.Add(new KeyValuePair <double, string>(1.0, "1.0"));
            comboBox.Items.Add(new KeyValuePair <double, string>(1.2, "1.2"));
            comboBox.Items.Add(new KeyValuePair <double, string>(2.0, "2.0"));
            comboBox.Items.Add(new KeyValuePair <double, string>(4.0, "4.0"));
            var binding = new Binding("VideoPlayerState.SpeedRatio")
            {
                Mode = BindingMode.TwoWay
            };

            BindingOperations.SetBinding(comboBox, Selector.SelectedValueProperty, binding);
        }
        private void InvalidateCommandMenus()
        {
            //var playbackCommands = this.ServiceProvider.GetRequiredService<PlaybackCommands>();
            //this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipFastBackwardVideoCommand));
            //this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipBackwardCommand));
            //this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.TogglePlayStateCommand));
            //this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipForwardCommand));
            //this.x_StackPanel_PlaybackCommands.Children.Add(AppCommandButton.FromAppCommand(playbackCommands.SkipFastForwardVideoCommand));
            ////
            //var timelineCommands = this.ServiceProvider.GetRequiredService<TimelineCommands>();
            //this.x_StackPanel_TimelineCommands.Children.Add(AppCommandButton.FromAppCommand(timelineCommands.CentreTimelineCommand));
            //this.x_StackPanel_TimelineCommands.Children.Add(AppCommandButton.FromAppCommand(timelineCommands.ZoomInTimelineCommand));
            //this.x_StackPanel_TimelineCommands.Children.Add(AppCommandButton.FromAppCommand(timelineCommands.ZoomOutTimelineCommand));
            //this.x_StackPanel_TimelineCommands.Children.Add(new Canvas { Width = 100, Height = 1 });
            //var markingCommands = this.ServiceProvider.GetRequiredService<MarkingCommands>();
            //this.x_StackPanel_TimelineCommands.Children.Add(AppCommandButton.FromAppCommand(markingCommands.ClearMarkInMsCommand));
            //this.x_StackPanel_TimelineCommands.Children.Add(AppCommandButton.FromAppCommand(markingCommands.SetMarkInCommand));

            //var comboBox = new ComboBox
            //{
            //    SelectedValuePath = "Key",
            //    DisplayMemberPath = "Value"
            //};
            //x_StackPanel_TimelineCommands.Children.Add(comboBox);
            //comboBox.Items.Add(new KeyValuePair<double, string>(0.25, "0.25"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(0.5, "0.5"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(0.75, "0.75"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(1.0, "1.0"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(1.2, "1.2"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(2.0, "2.0"));
            //comboBox.Items.Add(new KeyValuePair<double, string>(4.0, "4.0"));
            //var binding = new Binding("VideoPlayerState.SpeedRatio")
            //{
            //    Mode = BindingMode.TwoWay
            //};
            //BindingOperations.SetBinding(comboBox, Selector.SelectedValueProperty, binding);

            //
            var textManipCommands = this.ServiceProvider.GetRequiredService <TextManipulationCommands>();

            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(textManipCommands.InsertTimeCodeFromCursorCommand));
            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(textManipCommands.InsertTimeCodeFromMarkInCommand));
            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(textManipCommands.PreviousGrammarPointCommand));
            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(textManipCommands.NextGrammarPointCommand));
            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(textManipCommands.SplitSentencesCommand));
            var subManipCommands = this.ServiceProvider.GetRequiredService <SubtitleManipulationCommands>();

            this.x_StackPanel_TextCommands.Children.Add(AppCommandButton.FromAppCommand(subManipCommands.SplitCurrentSubtitleCommand));
        }