add versioninfo in nonclientarea

This commit is contained in:
NaBian committed 2020-11-14 22:51:14 +08:00
1 parent 5e31009dcf
commit 19be9982c2
11 files changed
+76 -40

No files matched your search

@@ -0,0 +1,58 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Data;
using HandyControl.Tools;
using HandyControlDemo.Data;
using HandyControlDemo.Properties.Langs;
using HandyControlDemo.Window;
namespace HandyControlDemo.UserControl
{
public partial class NonClientAreaContent
{
public NonClientAreaContent()
{
InitializeComponent();
}
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is string langName)
{
PopupConfig.IsOpen = false;
if (langName.Equals(GlobalData.Config.Lang)) return;
ConfigHelper.Instance.SetLang(langName);
LangProvider.Culture = new CultureInfo(langName);
Messenger.Default.Send<object>(null, "LangUpdated");
GlobalData.Config.Lang = langName;
GlobalData.Save();
}
}
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 MenuAbout_OnClick(object sender, RoutedEventArgs e)
{
new AboutWindow
{
Owner = Application.Current.MainWindow
}.ShowDialog();
}
}
}