示例#1
0
 private void FullscreenVideoTransportOsd_Loaded(object sender, RoutedEventArgs e)
 {
     // The silder has IsMoveToPointEnabled=true, which means it moves the thumb when we click the mouse, which also set handled to true
     // so we can't get the event. We need to turn event on so we can tell the slider to ignore position tick property notifications until
     // we get a mouse up and update the slider position. So we use AddHanlder, so we can catch handled events
     if (_previewMouseDown == null)
     {
         _previewMouseDown = new MouseButtonEventHandler(CurrentPositionSlider_PreviewMouseDown);
         CurrentPositionSlider.AddHandler(PreviewMouseDownEvent, _previewMouseDown, true);
     }
 }
示例#2
0
        private void FullscreenVideoTransportOsd_Unloaded(object sender, RoutedEventArgs e)
        {
            CurrentPositionSlider.RemoveHandler(PreviewMouseDownEvent, _previewMouseDown);
            _previewMouseDown = null;

            var vm = ViewModel;

            if (vm != null)
            {
                vm.PropertyChanged -= vm_PropertyChanged;
            }
        }