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