Skip to content

Commit

Permalink
Stop client download on window close.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNexusAvenger committed Mar 4, 2021
1 parent 85094b3 commit 32fb42c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion NLUL.GUI/Component/TopBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Top bar of the main window.
*/

using System.Diagnostics;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
Expand Down Expand Up @@ -35,7 +36,11 @@ public TopBar()
this.window.WindowState = WindowState.Minimized;
}
};
this.Get<ImageButton>("Close").ButtonPressed += (sender, args) => window?.Close();
this.Get<ImageButton>("Close").ButtonPressed += (sender, args) =>
{
window?.Close();
Process.GetCurrentProcess().Kill();
};

// Set the background for accepting events.
this.Background = new SolidColorBrush(new Color(0,0,0,0));
Expand Down

0 comments on commit 32fb42c

Please sign in to comment.