unison/App.xaml.cs

41 lines
1.0 KiB
C#
Raw Normal View History

using System.Windows;
using Hardcodet.Wpf.TaskbarNotification;
namespace unison
{
public partial class App : Application
{
private TaskbarIcon Systray;
private HotkeyHandler Hotkeys;
private SnapcastHandler Snapcast;
2021-08-16 00:13:47 +00:00
private MPDHandler MPD;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Hotkeys = new HotkeyHandler();
Current.Properties["hotkeys"] = Hotkeys;
Snapcast = new SnapcastHandler();
Current.Properties["snapcast"] = Snapcast;
2021-08-16 00:13:47 +00:00
MPD = new MPDHandler();
Current.Properties["mpd"] = MPD;
Current.MainWindow = new MainWindow();
Systray = (TaskbarIcon)FindResource("SystrayTaskbar");
2021-08-16 00:13:47 +00:00
Current.Properties["systray"] = Systray;
}
protected override void OnExit(ExitEventArgs e)
{
Systray.Dispose();
Snapcast.Stop();
Hotkeys.RemoveHotKeys();
base.OnExit(e);
}
}
}