Example #1
0
 /// <summary>
 /// 全屏的快捷功能,F11相当于单机按钮;Esc健,如果全屏则退出全屏
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MetroWindow_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.F11)
     {
         FullScreenHelper.GoFullscreen(this);
     }
     else if (e.Key == Key.Escape)//esc键盘退出全屏
     {
         FullScreenHelper.ExitFullscreen(this);
     }
 }
Example #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();
 }