-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
36 lines (34 loc) · 1.1 KB
/
App.xaml.cs
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
36
using HandyControl.Data;
using HandyControl.Tools;
using System;
using System.Windows;
namespace SinusCalculator
{
public partial class App
{
/// <summary>
/// Wird beim Starten der App aufgerufen
/// </summary>
private void Application_Startup(object sender, System.Windows.StartupEventArgs e)
{
//Setzt die Sprache und das Thema
ConfigHelper.Instance.SetLang("en");
this.UpdateSkin(SkinType.Dark);
}
/// <summary>
/// Setzt das Thema
/// </summary>
internal void UpdateSkin(SkinType skin)
{
this.Resources.MergedDictionaries.Clear();
this.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml")
});
this.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
});
}
}
}