-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.xaml.cs
More file actions
35 lines (29 loc) · 865 Bytes
/
App.xaml.cs
File metadata and controls
35 lines (29 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
namespace NoteUI;
public partial class App : Application
{
private Window? _window;
public App()
{
this.InitializeComponent();
}
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Lang.SetLanguage(AppSettings.LoadLanguage());
ApplyFontResource(AppSettings.LoadFontSetting());
ReminderService.Initialize();
_window = new MainWindow();
_window.Activate();
if (AppSettings.LoadStartMinimized())
{
var appWindow = _window.AppWindow;
appWindow.Hide();
}
}
public static void ApplyFontResource(string font)
{
var fontFamily = AppSettings.GetFontFamily(font);
Application.Current.Resources["ContentControlThemeFontFamily"] = fontFamily;
}
}