From d82ce8037499ff425936fafe7f18b0dddaf7f171 Mon Sep 17 00:00:00 2001 From: liufei Date: Sun, 9 Jan 2022 15:42:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=81=AE=E7=BD=A9=E5=B1=82?= =?UTF-8?q?=E8=BF=87=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Windows/IconfontWindow.xaml.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Control/Windows/IconfontWindow.xaml.cs b/Control/Windows/IconfontWindow.xaml.cs index e705650..22000cf 100644 --- a/Control/Windows/IconfontWindow.xaml.cs +++ b/Control/Windows/IconfontWindow.xaml.cs @@ -27,7 +27,7 @@ namespace GeekDesk.Control.Windows public static IconfontViewModel vm; private IconfontWindow(List icons, MenuInfo menuInfo) { - + InitializeComponent(); systemIcons = icons; @@ -57,6 +57,7 @@ namespace GeekDesk.Control.Windows private void Close_Click(object sender, RoutedEventArgs e) { + this.DataContext = null; this.Close(); } @@ -73,13 +74,15 @@ namespace GeekDesk.Control.Windows LoadingEle.Visibility = Visibility.Visible; CustomIcon.Visibility = Visibility.Collapsed; HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig), "IconUrlDialog"); - } else + } + else { if (customIcons == null) { vm.Iconfonts = null; LoadingOnlineIcon(); - } else + } + else { vm.Iconfonts = customIcons; LoadingEle.Visibility = Visibility.Collapsed; @@ -121,6 +124,7 @@ namespace GeekDesk.Control.Windows } break; } + this.DataContext = null; this.Close(); } @@ -139,7 +143,7 @@ namespace GeekDesk.Control.Windows private void CustomButton_Click(object sender, RoutedEventArgs e) { - HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig)); + HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig), "IconUrlDialog"); } @@ -148,7 +152,8 @@ namespace GeekDesk.Control.Windows if (CheckSettingUrl.Text == "true") { LoadingOnlineIcon(); - } else + } + else { LoadingEle.IsRunning = true; CustomIcon.Visibility = Visibility.Collapsed; @@ -168,9 +173,10 @@ namespace GeekDesk.Control.Windows LoadingEle.Visibility = Visibility.Collapsed; CustomIcon.Visibility = Visibility.Visible; } - catch (Exception) + catch (Exception e) { HandyControl.Controls.Growl.WarningGlobal("加载远程图标异常!"); + LogUtil.WriteErrorLog(e, "加载远程图标异常!"); } } @@ -178,6 +184,7 @@ namespace GeekDesk.Control.Windows { if (e.Key == Key.Escape) { + this.DataContext = null; this.Close(); } }