Exemple #1
0
        public void play()
        {
            if (MainWindow.fileName != "" && playstate == 0)
            {
                Module.readFile();
                mediaElement.Source = new Uri(MainWindow.fileName, UriKind.Relative);

                mediaElement.Play();

                if (FullScreenHelper.IsFullscreen(this))
                {
                    FullScreenHelper.ExitFullscreen(this);
                }
                else
                {
                    FullScreenHelper.GoFullscreen(this);
                }
                mediaElement.Width  = ActualWidth;
                mediaElement.Height = ActualWidth;
                playstate           = 1;
                return;
            }
            if (playstate == 2)
            {
                mediaElement.Play();
                playstate = 1;
            }
        }
Exemple #2
0
 /// <summary>
 /// 双击窗体,退出全屏
 /// </summary>
 private void myContent_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (FullScreenHelper.IsFullscreen(this))
     {
         FullScreenHelper.ExitFullscreen(this);
     }
     else
     {
         FullScreenHelper.GoFullscreen(this);
     }
     //this.Visibility = Visibility.Hidden;
     this.Hide();
 }