コード例 #1
0
        internal void RestoreWindowPosition(BasicWindow window)
        {
            string key = window.GetType().FullName;

            if (WindowManager.Instance.Windows.ContainsKey(key))
            {
                var v = WindowManager.Instance.Windows[window.GetType().FullName];
                if (v.Left > SystemParameters.VirtualScreenLeft && v.Left < SystemParameters.VirtualScreenWidth + SystemParameters.VirtualScreenLeft)
                {
                    window.Left = v.Left + 8;
                }
                if (v.Top > SystemParameters.VirtualScreenTop && v.Top < SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight)
                {
                    window.Top = v.Top + 30;
                }
                if (v.WindowState == WindowState.Maximized)
                {
                    window.Width       = 1280;
                    window.Height      = 800;
                    window.WindowState = WindowState.Maximized;
                }
                else
                {
                    window.Width  = v.Width;
                    window.Height = v.Height;
                }
            }
        }
コード例 #2
0
 internal void SaveWindowPosition(BasicWindow window)
 {
     Instance.Windows[window.GetType().FullName] = new WindowPosition()
     {
         Left        = window.Left,
         Top         = window.Top,
         Width       = window.ActualWidth,
         Height      = window.ActualHeight,
         WindowState = window.WindowState,
     };
 }