示例#1
0
        public void SetFullScreen(bool value)
        {
            ClosedByFullScreen = true;
            var screen = System.Windows.Forms.Screen.FromHandle(
                new System.Windows.Interop.WindowInteropHelper(this).Handle);


            var nWin = new Projektor(Timer, Parent);

            nWin.Timer = this.Timer;

            if (value)
            {
                object[] values =
                {
                    this.ActualHeight,
                    this.ActualWidth,
                    this.Left,
                    this.Top
                };

                if (screen != null)
                {
                    var workingArea = screen.Bounds;
                    nWin.Left   = workingArea.Left;
                    nWin.Top    = workingArea.Top;
                    nWin.Width  = workingArea.Width;
                    nWin.Height = workingArea.Height;

                    nWin.Tag                = values;
                    nWin.WindowStyle        = WindowStyle.None;
                    nWin.AllowsTransparency = true;
                }
            }

            else if (this.Tag != null)
            {
                nWin.Height = (double)((object[])this.Tag)[0];
                nWin.Width  = (double)((object[])this.Tag)[1];
                nWin.Left   = (double)((object[])this.Tag)[2];
                nWin.Top    = (double)((object[])this.Tag)[3];


                //this.WindowStyle = WindowStyle.SingleBorderWindow;
                ////this.AllowsTransparency = false;
                //this.WindowState = WindowState.Normal;
            }



            nWin.Show();
            Parent.projek = nWin;
            this.Close();
        }
        private void Menu_Projektor_Checked(object sender, RoutedEventArgs e)
        {
            if (Menu_Projektor.IsChecked ?? false)
            {
                projek = new Views.Projektor(view_forside.stopwatch, this);

                projek.Show();
            }
            else
            {
                projek.Close();
            }
        }