Exemplo n.º 1
0
 /// <summary>
 /// 设置窗体的基本显示参数
 /// </summary>
 /// <param name="window"></param>
 /// <param name="topmost">窗口是否出现在 Z 顺序的最顶层 </param>
 /// <param name="style">窗口的边框样式</param>
 /// <param name="mode">窗口大小调整模式</param>
 /// <param name="state">窗口是处于还原、最小化还是最大化状态</param>
 public static void SettingWindowState(this Window window, bool topmost, System.Windows.WindowStyle style, ResizeMode mode, WindowState state)
 {
     window.Topmost     = topmost;
     window.WindowStyle = style;
     window.ResizeMode  = mode;
     window.WindowState = state;
 }
Exemplo n.º 2
0
        public static WindowStyle ToEto(this sw.WindowStyle style)
        {
            switch (style)
            {
            case sw.WindowStyle.None:
                return(WindowStyle.None);

            case sw.WindowStyle.ThreeDBorderWindow:
                return(WindowStyle.Default);

            default:
                throw new NotSupportedException();
            }
        }
 private void FullScreen()
 {
     if (this.WindowState != System.Windows.WindowState.Maximized)
     {
         currentState = this.WindowState;
         currentStyle = this.WindowStyle;
         this.WindowState = System.Windows.WindowState.Maximized;
         WindowStartupLocation = WindowStartupLocation.CenterOwner;
         this.Topmost = false;
         this.WindowStyle = System.Windows.WindowStyle.None;
         this.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
         this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
         this.Hide();
         this.Show();
     }
     else
     {
         System.Windows.WindowState temp = this.WindowState;
         System.Windows.WindowStyle style = this.WindowStyle;
         WindowStartupLocation = WindowStartupLocation.CenterOwner;
         this.WindowState = currentState;
         this.WindowStyle = currentStyle;
         currentState = temp;
         currentStyle = style;
         this.Height = this.currentheight.HasValue == true ? 350 : this.currentheight.Value;
         this.Width = this.currentwidth.HasValue == true ? 525 : this.currentwidth.Value;
         this.Left = this.currentwidth.HasValue == true ? 0 : this.currentleft.Value; ;
         this.Top = this.currentwidth.HasValue == true ? 0 : this.currenttop.Value; ;
     }
     SubPageFullScreen();
 }