private void Oplaty_button_Click(object sender, RoutedEventArgs e)
 {
     if (scr == null)
     {
         Ekran_Glowny scr = new Ekran_Glowny();
         scr.Show();
     }
     else
     {
         scr.Close();
         //  Ekran_Glowny scr = new Ekran_Glowny();
         scr.Show();
     }
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (rej001 == null)
            {
                rej001 = new Ekran_Glowny();
                rej001.Show();
                rej001.ref_ekran_glowny(ark);
            }
            else
            {
                if (rej001 != null)
                {
                    rej001.Close();
                }

                rej001 = new Ekran_Glowny();
                rej001.Show();
                //rej001.ref_ekran_glowny(this);
            }

            this.Close();
        }
        private void Button_Click_1(object sender, RoutedEventArgs e) //logowanie
        {
            //new Historia_operacji().Show();
            if (rej001 == null)
            {
                rej001 = new Ekran_Glowny();
                rej001.Show();
            }
            else
            {
                if (rej001 != null)
                {
                    rej001.Close();
                }

                rej001 = new Ekran_Glowny();
                rej001.Show();
                //rej001.ref_ekran_glowny(this);
            }

            this.Visibility = Visibility.Hidden;
            rej001.ref_ekran_glowny(this);
        }