Beispiel #1
0
        public void Handle(FullscreenEvent message)
        {
            switch (message.Fullscreen)
            {
            case true:
                currentStateNonFullscreen = this.WindowState;
                SolidColorBrush bg = new SolidColorBrush();
                bg.Opacity = 0.5;
                Background = bg;
                IgnoreTaskbarOnMaximize = true;
                ShowTitleBar            = false;
                Topmost               = true;
                WindowState           = WindowState.Maximized;
                MenuButton.Visibility = Visibility.Collapsed;


                // Second Screen!!
                //var secondaryScreen = System.Windows.Forms.Screen.AllScreens.Where(s => !s.Primary).FirstOrDefault();

                //if (secondaryScreen != null)
                //{
                //    if (!this.IsLoaded)
                //        this.WindowStartupLocation = WindowStartupLocation.Manual;

                //    var workingArea = secondaryScreen.WorkingArea;
                //    this.Left = workingArea.Left;
                //    this.Top = workingArea.Top;
                //    this.Width = workingArea.Width;
                //    this.Height = workingArea.Height;
                //    // If window isn't loaded then maxmizing will result in the window displaying on the primary monitor
                //    if (this.IsLoaded)
                //        this.WindowState = WindowState.Maximized;
                //}



                //if (System.Windows.Forms.Screen.AllScreens.Count() == 2)
                //{
                //    var primaryDisplay = System.Windows.Forms.Screen.AllScreens.ElementAtOrDefault(0);
                //    var extendedDisplay = System.Windows.Forms.Screen.AllScreens.FirstOrDefault(s => s != primaryDisplay) ?? primaryDisplay;
                //}


                break;

            case false:
                ClearValue(BackgroundProperty);
                IgnoreTaskbarOnMaximize = false;
                ShowTitleBar            = true;
                Topmost               = false;
                WindowState           = currentStateNonFullscreen;
                MenuButton.Visibility = Visibility.Visible;
                break;

            default:
                break;
            }
        }
        public void Handle(FullscreenEvent message)
        {
            if (message.Fullscreen)
            {
                _lastNonFullScreenItem = ActiveItem;
                Items.Clear();
                Items.Add(_allTabs.First(t => t is ResultListViewModel));
                ActiveItem = Items.First();
            }
            else
            {
                Items.Clear();
                Items.AddRange(_allTabs);
                ActiveItem = _lastNonFullScreenItem;
            }

            foreach (IResultViewTabItem tab in Items)
            {
                tab.DisplayName = tab.GetTabTitle(message.Fullscreen);
            }
        }
Beispiel #3
0
        public void Handle(FullscreenEvent message)
        {
            switch (message.Fullscreen)
            {
            case true:

                MediaPlayer.SetValue(Grid.RowSpanProperty, 4);
                //SolidColorBrush bg = new SolidColorBrush(Colors.Black);
                //bg.Opacity = 0.5;
                //MediaControl1.Background = bg;
                //MediaControl2.Background = bg;

                //MediaControl1.ClearValue(BackgroundProperty);


                //// For each screen, add the screen properties to a list box.
                //foreach (var screen in System.Windows.Forms.Screen.AllScreens)
                //{

                //    listBox1.Items.Add("Device Name: " + screen.DeviceName);
                //    listBox1.Items.Add("Bounds: " +
                //        screen.Bounds.ToString());
                //    listBox1.Items.Add("Type: " +
                //        screen.GetType().ToString());
                //    listBox1.Items.Add("Working Area: " +
                //        screen.WorkingArea.ToString());
                //    listBox1.Items.Add("Primary Screen: " +
                //        screen.Primary.ToString());
                //};
                break;

            case false:
                MediaPlayer.SetValue(Grid.RowSpanProperty, 1);
                break;

            default:
                break;
            }
        }
 public void Handle(FullscreenEvent message)
 {
     IsFullScreen = message.Fullscreen;
 }
 public void Handle(FullscreenEvent message)
 {
     ReduceHitlist(message.Fullscreen);
 }