Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Visne committed Oct 12, 2023
1 parent c4a78ca commit f7e1e73
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Turbulence.Desktop/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@ namespace Turbulence.Desktop;

public partial class MainWindow : Window
{
SettingsWindow? _settingsWindow;
private SettingsWindow? _settingsWindow;
public MainWindow()
{
InitializeComponent();
}

public async void OnSettings(object? _1, RoutedEventArgs _2)
{
//TODO: instead show as a independent window?
_settingsWindow = new();
// TODO: instead show as a independent window?
_settingsWindow = new SettingsWindow();
await _settingsWindow.ShowDialog(this);
}

public void OnExit(object? _1, RoutedEventArgs _2)
{
var current = Application.Current;
if (current == null)
return;

var lifetime = current.ApplicationLifetime;
if (lifetime is IClassicDesktopStyleApplicationLifetime desktop)
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
desktop.Shutdown();
}
}

0 comments on commit f7e1e73

Please sign in to comment.