update to v1.4.0

This commit is contained in:
NaBian committed 2018-10-27 20:01:47 +08:00
1 parent ca0c8ce7a0
commit 9bc1208484
125 files changed
+891 -483

No files matched your search

@@ -3,9 +3,8 @@ using System.Diagnostics;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using HandyControl.Controls;
using HandyControl.Data.Enum;
using HandyControlDemo.Data;
// ReSharper disable once CheckNamespace
@@ -16,17 +15,13 @@ namespace HandyControlDemo.UserControl
public NoUserContent()
{
InitializeComponent();
ImageLang.Source = BitmapFrame.Create(new Uri($"pack://application:,,,/HandyControlDemo;component/Resources/Img/Flag/{GlobalData.Config.Lang}.png"));
}
private void ButtonLang_OnClick(object sender, RoutedEventArgs e) => PopupLang.IsOpen = true;
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is string tag)
{
PopupLang.IsOpen = false;
PopupConfig.IsOpen = false;
if (tag.Equals(GlobalData.Config.Lang)) return;
Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
{
@@ -39,5 +34,27 @@ namespace HandyControlDemo.UserControl
});
}
}
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is SkinType tag)
{
PopupConfig.IsOpen = false;
if (tag.Equals(GlobalData.Config.Skin)) return;
GlobalData.Config.Skin = tag;
GlobalData.Save();
((App)Application.Current).UpdateSkin(tag);
}
}
private void MenuItemLinks_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is MenuItem menuItem && menuItem.Tag is string tag)
{
Process.Start(tag);
}
}
}
}