Пример #1
0
 private void MainWindow1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Escape && fullscreen == true)
     {
         WindowState = System.Windows.WindowState.Normal;
         WindowStyle = System.Windows.WindowStyle.SingleBorderWindow;
         fullscreen  = false;
     }
     if (e.Key == Key.Space)
     {
         if (IsPlaying == false)
         {
             MElem.Play();
             IsPlaying = true;
         }
         else
         {
             MElem.Pause();
             IsPlaying = false;
         }
     }
     if (e.Key == Key.Left || e.Key == Key.B)
     {
         Btn_Prev.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent));
     }
     if (e.Key == Key.Right || e.Key == Key.N)
     {
         Btn_Next.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent));
     }
 }
Пример #2
0
 private void btn_Pause_Click(object sender, RoutedEventArgs e)
 {
     MElem.Pause();
     IsPlaying = false;
 }
Пример #3
0
 private void VSlide_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
 {
     MElem.Pause();
     IsPlaying = false;
 }