Initial code

This commit is contained in:
2024-09-26 17:48:18 -04:00
parent 716043a901
commit c4cd246fb0
13 changed files with 605 additions and 0 deletions

38
App.xaml.cs Normal file
View File

@@ -0,0 +1,38 @@
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using Settings = WorldClockStatusWindow.Properties.Settings;
namespace WorldClockStatusWindow;
public partial class App
{
private List<IDisposable> _windowSourceList;
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();
});
_windowSourceList =
[
new WindowSource()
];
}
protected override void OnExit(ExitEventArgs e)
{
_windowSourceList.ForEach(ws => ws.Dispose());
base.OnExit(e);
}
}