mirror of
https://github.com/ckaczor/SystemTemperatureStatusWindow.git
synced 2026-01-21 01:25:42 -05:00
Split into service and UI
This commit is contained in:
34
Window/App.xaml.cs
Normal file
34
Window/App.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using FloatingStatusWindowLibrary;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using SystemTemperatureStatusWindow.Properties;
|
||||
|
||||
namespace SystemTemperatureStatusWindow
|
||||
{
|
||||
public partial class App
|
||||
{
|
||||
private WindowSource _windowSource;
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
StartManager.ManageAutoStart = true;
|
||||
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
|
||||
StartManager.AutoStartChanged += (value =>
|
||||
{
|
||||
Settings.Default.AutoStart = value;
|
||||
Settings.Default.Save();
|
||||
});
|
||||
|
||||
_windowSource = new WindowSource();
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
_windowSource.Dispose();
|
||||
|
||||
base.OnExit(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user