//public BlackScreen()
        //{
        //	InitializeComponent();
        //}

        public BlackScreen(string msg, SettingWindow main)
        {
            InitializeComponent();
            SettingWindow  = main;
            WindowOpenTime = DateTime.Now;
            NewMethod(msg);
            closeBlackScreen();
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (!SettingWindow.IsClosed)
     {
         SettingWindow.ShowInTaskbar = true;
         SettingWindow.Show();
     }
     Close();
 }
 private void T_Elapsed(object sender, ElapsedEventArgs e)
 {
     if ((DateTime.Now - WindowOpenTime) >= SettingWindow.BlackScreenTime)
     {
         Dispatcher.BeginInvoke(new Action(() =>
         {
             t.Enabled = false;
             Close();
             if (!SettingWindow.IsClosed)
             {
                 SettingWindow.WindowState   = WindowState.Minimized;
                 SettingWindow.ShowInTaskbar = true;
                 SettingWindow.Show();
             }
         }));
     }
 }
        private void OnSettingsClicked(object sender, RoutedEventArgs e)
        {
            var settingWindow = new SettingWindow();

            settingWindow.Show();
        }