示例#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;
     }
 }
示例#3
0
 private void stopVideo(VideoControl control)
 {
     control.ViewModel.VideoId = null;
 }
示例#4
0
 private void setVideoStretch(VideoControl control, Stretch stretch)
 {
     control.videoDisp.ViewModel.StretchMode = stretch;
 }
示例#5
0
 private System.Drawing.Image getSnapshot(VideoControl control)
 {
     return(control.videoDisp.ViewModel.GetSnapshot());
 }
示例#6
0
 private void clearVideoImage(VideoControl control)
 {
     control.videoDisp.ViewModel.ClearVideoImage();
 }
示例#7
0
 private void playVideo(VideoControl control, string videoId)
 {
     control.ViewModel.VideoId = videoId;
 }