Пример #1
0
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            Settings1 ps = Settings1.Default;

            ps.Top  = this.Top;
            ps.Left = this.Left;


            if (this.WindowState == WindowState.Maximized)
            {
                ps.SizeToContent = 1;
            }
            else
            {
                ps.SizeToContent = 0;
                ps.Width         = this.Width;
                ps.Height        = this.Height;
            }



            ps.Save();
        }
Пример #2
0
        void loadpage()
        {
            log.Add("установим размеры окна окна");
            Settings1 ps = Settings1.Default;

            if (ps.Top == -100)
            {
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            }
            else
            {
                this.Top  = ps.Top;
                this.Left = ps.Left;
            }
            if (ps.SizeToContent == 1)
            {
                this.WindowState = WindowState.Maximized;
            }
            else
            {
                this.Width  = ps.Width;
                this.Height = ps.Height;
            }
        }