Esempio n. 1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            kommunikacii_Set ps = kommunikacii_Set.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.lb1sel  = lb1.SelectedIndex;
            ps.lb2sel  = lb2.SelectedIndex;
            ps.lb4sel  = lb4.SelectedIndex;
            ps.tab1sel = tab1.SelectedIndex;


            ps.Save();
        }
Esempio n. 2
0
        void loadpage()
        {
            try
            {
                kommunikacii_Set ps = kommunikacii_Set.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;
                }

                tab1.SelectedIndex = ps.tab1sel;
                if (ps.tab1sel == 0)
                {
                    // lb3.SelectedIndex = ps.lb3sel;
                    //    lb4.Visibility = Visibility.Visible;
                    //    stpan.Visibility = Visibility.Visible;
                }
                else
                {
                    lb2.SelectedIndex = ps.lb2sel;
                    //   lb1.Visibility = Visibility.Visible;
                    //    btnserv.Visibility = Visibility.Visible;
                }

                lb1_selitem = ps.lb1sel;
                lb4_selitem = ps.lb4sel;
            }
            catch
            {
            }
        }