private void SettingsBtn_Click(object sender, RoutedEventArgs e)
 {
     if (_settingsWindow == null || _settingsWindow.IsVisible == false)
     {
         _settingsWindow = new SettingsWindow();
         _settingsWindow.Show();
     }
     else
     {
         _settingsWindow.WindowState = WindowState.Normal;
         _settingsWindow.Activate();
     }
 }
 private void SettingsBtn_Click(object sender, RoutedEventArgs e)
 {
     if (_settingsWindow != null && _settingsWindow.TryGetTarget(out var sw))
     {
         sw.Show();
         sw.WindowState = WindowState.Normal;
         sw.Activate();
     }
     else
     {
         sw = new SettingsWindow();
         _settingsWindow = new WeakReference <SettingsWindow>(sw);
         sw.Show();
     }
 }
Example #3
0
        private void SettingsBtn_Click(object sender, RoutedEventArgs e)
        {
            SettingsWindow sw = new SettingsWindow();

            sw.Show();
        }