27 lines
744 B
C#
27 lines
744 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls.Notifications;
|
|
using Ocarina2.ViewModels;
|
|
using ReactiveUI;
|
|
|
|
namespace Ocarina2.Views;
|
|
|
|
public partial class MainWindow : Window
|
|
{
|
|
public static WindowNotificationManager WindowNotificationManager;
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
WindowNotificationManager = new WindowNotificationManager(this);
|
|
Closing += (sender, args) =>
|
|
{
|
|
// dispose on close
|
|
if (sender == null) return;
|
|
if (sender.ToString() != "Ocarina2.Views.MainWindow") return;
|
|
App.Client.Dispose();
|
|
(DataContext as MainWindowViewModel)?.Stop();
|
|
};
|
|
}
|
|
} |