Example #1
0
        private VideoControl createVideoControl()
        {
            VideoControl ctrl = new VideoControl();

            ctrl.DataContext = new VideoControlModel(true)
            {
                CloseBtnVisibility = Visibility.Collapsed, FullScreenBtnVisibility = Visibility.Collapsed
            };
            return(ctrl);
        }
 void loadVideoControl()
 {
     if (VideoControl == null)
     {
         VideoControl             = new VideoControl();
         VideoControl.DataContext = ViewModel.ControlViewModel;
         //绑定透明度
         Binding binding = new Binding();
         binding.Mode = BindingMode.OneWay;
         binding.Path = new PropertyPath(nameof(ViewModel.ControlViewModel.Opacity));
         VideoControl.SetBinding(VideoControl.OpacityProperty, binding);
         gridPanel.Children.Add(VideoControl);
     }
     else
     {
         VideoControl.Visibility = Visibility.Visible;
     }
 }
Example #3
0
 private void stopVideo(VideoControl control)
 {
     control.ViewModel.VideoId = null;
 }
Example #4
0
 private void setVideoStretch(VideoControl control, Stretch stretch)
 {
     control.videoDisp.ViewModel.StretchMode = stretch;
 }
Example #5
0
 private System.Drawing.Image getSnapshot(VideoControl control)
 {
     return(control.videoDisp.ViewModel.GetSnapshot());
 }
Example #6
0
 private void clearVideoImage(VideoControl control)
 {
     control.videoDisp.ViewModel.ClearVideoImage();
 }
Example #7
0
 private void playVideo(VideoControl control, string videoId)
 {
     control.ViewModel.VideoId = videoId;
 }