update to v1.4.0
This commit is contained in:
1 parent
ca0c8ce7a0
commit
9bc1208484
125 files changed
+891
-483
No files matched your search
@@ -1,6 +1,9 @@
|
||||
using System.Globalization;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using HandyControl.Data.Enum;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo
|
||||
@@ -16,6 +19,11 @@ namespace HandyControlDemo
|
||||
|
||||
GlobalData.Init();
|
||||
Thread.CurrentThread.CurrentUICulture = new CultureInfo(GlobalData.Config.Lang);
|
||||
|
||||
if (GlobalData.Config.Skin != SkinType.Default)
|
||||
{
|
||||
UpdateSkin(GlobalData.Config.Skin);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
@@ -23,5 +31,24 @@ namespace HandyControlDemo
|
||||
base.OnExit(e);
|
||||
GlobalData.Save();
|
||||
}
|
||||
|
||||
internal void UpdateSkin(SkinType skin)
|
||||
{
|
||||
var skins0 = Resources.MergedDictionaries[0];
|
||||
skins0.MergedDictionaries.Clear();
|
||||
skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(skin));
|
||||
skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(typeof(App).Assembly, "Resources/Themes", skin));
|
||||
|
||||
var skins1 = Resources.MergedDictionaries[1];
|
||||
skins1.MergedDictionaries.Clear();
|
||||
skins1.MergedDictionaries.Add(new ResourceDictionary
|
||||
{
|
||||
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
|
||||
});
|
||||
skins1.MergedDictionaries.Add(new ResourceDictionary
|
||||
{
|
||||
Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user