From 1e7c0253914be57da7c2be8892a3ff68fceda576 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Wed, 29 May 2019 00:02:32 +0800 Subject: [PATCH] Synchronize versions --- .../UserControl/Main/NoUserContent.xaml | 38 +++++++++++++------ .../UserControl/Main/NoUserContent.xaml.cs | 29 ++------------ .../Themes/Styles/Window.xaml | 4 ++ .../UserControl/Main/NoUserContent.xaml | 36 ++++++++++++------ .../UserControl/Main/NoUserContent.xaml.cs | 28 ++------------ .../Themes/Styles/Window.xaml | 4 ++ .../UserControl/Main/NoUserContent.xaml.cs | 1 - .../HandyControlDemo_Shared/App.xaml.cs | 3 ++ .../ViewModel/Main/NoUserViewModel.cs | 4 ++ 9 files changed, 72 insertions(+), 75 deletions(-) diff --git a/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml b/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml index 6412815f..ba1c6ec4 100644 --- a/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml +++ b/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml @@ -3,7 +3,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs" Height="29" - xmlns:hc="https://handyorg.github.io/handycontrol"> + DataContext="{Binding NoUser,Source={StaticResource Locator}}" + xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:data="clr-namespace:HandyControlDemo.Data"> @@ -20,36 +22,41 @@ - + - + - + - + + + + + + - + - + - + @@ -60,10 +67,17 @@ - - - - + + + + + + + + + + + diff --git a/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml.cs b/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml.cs index 2c886173..00d824ce 100644 --- a/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml.cs +++ b/src/Core_30/HandyControlDemo_Core_30/UserControl/Main/NoUserContent.xaml.cs @@ -1,14 +1,11 @@ using System.Diagnostics; using System.Windows; using System.Windows.Controls; -using GalaSoft.MvvmLight.Messaging; using HandyControl.Controls; using HandyControl.Data; using HandyControlDemo.Data; -using HandyControlDemo.Tools; using HandyControlDemo.Window; - namespace HandyControlDemo.UserControl { public partial class NoUserContent @@ -29,7 +26,9 @@ namespace HandyControlDemo.UserControl if (!b) return true; GlobalData.Config.Lang = tag; GlobalData.Save(); - Process.Start(Process.GetCurrentProcess().MainModule.FileName); + var processModule = Process.GetCurrentProcess().MainModule; + if (processModule != null) + Process.Start(processModule.FileName); Application.Current.Shutdown(); return true; }); @@ -50,28 +49,6 @@ namespace HandyControlDemo.UserControl } } - private void MenuItemLinks_OnClick(object sender, RoutedEventArgs e) - { - if (e.OriginalSource is MenuItem menuItem && menuItem.Tag is string tag) - { - Process.Start(tag); - } - } - - private void MenuItemQQGroup_OnClick(object sender, RoutedEventArgs e) - { - Messenger.Default.Send(null, MessageToken.ClearLeftSelected); - Messenger.Default.Send(true, MessageToken.FullSwitch); - Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.QQGroupView}"), MessageToken.LoadShowContent); - } - - private void MenuItemContributors_OnClick(object sender, RoutedEventArgs e) - { - Messenger.Default.Send(null, MessageToken.ClearLeftSelected); - Messenger.Default.Send(true, MessageToken.FullSwitch); - Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.ContributorsView}"), MessageToken.LoadShowContent); - } - private void MenuAbout_OnClick(object sender, RoutedEventArgs e) { new AboutWindow diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml index c93bc3f5..042c245e 100644 --- a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml +++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml @@ -46,6 +46,10 @@ + + + +