mirror of
https://github.com/ckaczor/HomeStatusWindow.git
synced 2026-02-01 17:24:30 -05:00
Initial commit to GitHub
This commit is contained in:
34
App.xaml.cs
Normal file
34
App.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using FloatingStatusWindowLibrary;
|
||||
using HomeStatusWindow.Properties;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
|
||||
namespace HomeStatusWindow
|
||||
{
|
||||
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