Пример #1
0
        public static void LoadWindowSizeAndPosition(Window window)
        {
            if (!WindowSettings.ContainsKey(window.GetType().ToString()))
            {
                return;
            }

            var settings = WindowSettings[window.GetType().ToString()];

            if (
                settings.Left < SystemParameters.PrimaryScreenWidth &&
                settings.Top < SystemParameters.PrimaryScreenHeight
                )
            {
                window.Left   = settings.Left;
                window.Top    = settings.Top;
                window.Width  = settings.Width;
                window.Height = settings.Height;
            }
        }