Exemplo n.º 1
0
        public static void ResizeWindows(WindowSizes ws)
        {
            var    screen = ScreenHelper.GetCurrentScreenSize(Application.Current.MainWindow);
            double w, h;

            if (ws == WindowSizes.Normal)
            {
                w = 1000;
                h = 540;
            }
            else
            {
                w = 1152;
                h = 648;
            }

            if (screen.Width < w || screen.Height < h)
            {
                MainWindow.ErrorDialog("Current monitor does not have the needed resolution for large mode");
                return;
            }

            Application.Current.MainWindow.Width  = w;
            Application.Current.MainWindow.Height = h;
            foreach (var window in _childs)
            {
                window.Width  = w;
                window.Height = h;
            }
        }