Exemple #1
0
        public static void OpenWindowInSecondaryScreen()
        {
            var secondaryScreen = Screen.AllScreens.FirstOrDefault(s => !s.Primary);

            if (secondaryScreen != null)
            {
                var window = new FullscreenWindow();
                window.WindowStartupLocation = WindowStartupLocation.Manual;
                window.Top = secondaryScreen.WorkingArea.Top;
                window.Left = secondaryScreen.WorkingArea.Left;
                window.Width = secondaryScreen.WorkingArea.Width;
                window.Height = secondaryScreen.WorkingArea.Height;

                window.Show();
            }
        }
Exemple #2
0
        public static void OpenWindowInAllScreens()
        {
            var window = new FullscreenWindow();
            window.labelContent.Content = "Window in all screens";

            window.WindowStartupLocation = WindowStartupLocation.Manual;
            double width = 0;
            double height = 0;
            var primaryScreen = Screen.AllScreens.FirstOrDefault(s => s.Primary);

            foreach (var screen in Screen.AllScreens)
            {
                width += screen.WorkingArea.Width;
                height += screen.WorkingArea.Height;
            }

            window.Top = 0;
            window.Left = 0;
            window.Width = primaryScreen.WorkingArea.Left + width;
            window.Height = primaryScreen.WorkingArea.Bottom + height;

            window.Show();
        }