From 94534c380609c2ecc2d56ee45daef702f3dc4f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=AB=E5=9F=8Evia?= <969954321@qq.com> Date: Fri, 3 Dec 2021 19:08:03 +0800 Subject: [PATCH] v2.2.15.1-alpha (#48) --- .../Controls/IconPresenter.cs | 1 + .../Implements/PendingHandlerImpl.cs | 19 ++++++++++++------- .../Panuon.UI.Silver/Helpers/IconHelper.cs | 16 ++++++++++++++++ .../Properties/AssemblyInfo.cs | 4 ++-- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Controls/IconPresenter.cs b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Controls/IconPresenter.cs index 13906c9e..2cca73e3 100644 --- a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Controls/IconPresenter.cs +++ b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Controls/IconPresenter.cs @@ -68,6 +68,7 @@ private void UpdateBinding() FrameworkElementUtil.BindingPropertyIfUndefaultAndUninherited(this, FontFamilyProperty, Source, IconHelper.FontFamilyProperty); FrameworkElementUtil.BindingPropertyIfUndefaultAndUninherited(this, ForegroundProperty, Source, IconHelper.ForegroundProperty); FrameworkElementUtil.BindingPropertyIfUndefaultAndUninherited(this, FontSizeProperty, Source, IconHelper.FontSizeProperty); + FrameworkElementUtil.BindingPropertyIfUndefaultAndUninherited(this, ToolTipProperty, Source, IconHelper.ToolTipProperty); FrameworkElementUtil.BindingPropertyIfUndefaultAndUninherited(this, VisibilityProperty, this, ContentProperty, new NullToCollapseConverter()); } } diff --git a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Implements/PendingHandlerImpl.cs b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Implements/PendingHandlerImpl.cs index d08a86de..05d0b8ad 100644 --- a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Implements/PendingHandlerImpl.cs +++ b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver.Internal/Implements/PendingHandlerImpl.cs @@ -25,13 +25,15 @@ public PendingHandlerImpl() #region Methods public void Close() { - if(_window.IsAlive && _window.Target is PendingBoxWindow window) { - window.Dispatcher.Invoke(new Action(() => + if (window.Dispatcher.CheckAccess()) { - window.Close(); - })); + window.Dispatcher.Invoke(new Action(() => + { + window.Close(); + })); + } } } #endregion @@ -58,10 +60,13 @@ public void UpdateMessage(string message) { if (_window.IsAlive && _window.Target is PendingBoxWindow window) { - window.Dispatcher.Invoke(new Action(() => + if (window.Dispatcher.CheckAccess()) { - window.UpdateMessage(message); - })); + window.Dispatcher.Invoke(new Action(() => + { + window.UpdateMessage(message); + })); + } } } #endregion diff --git a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Helpers/IconHelper.cs b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Helpers/IconHelper.cs index a7e2df16..a0d9707c 100644 --- a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Helpers/IconHelper.cs +++ b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Helpers/IconHelper.cs @@ -187,6 +187,22 @@ public static void SetForeground(DependencyObject obj, Brush value) DependencyProperty.RegisterAttached("Foreground", typeof(Brush), typeof(IconHelper), new PropertyMetadata(Brushes.Black)); #endregion + #region ToolTip + public static object GetToolTip(DependencyObject obj) + { + return (object)obj.GetValue(ToolTipProperty); + } + + public static void SetToolTip(DependencyObject obj, object value) + { + obj.SetValue(ToolTipProperty, value); + } + + public static readonly DependencyProperty ToolTipProperty = + DependencyProperty.RegisterAttached("ToolTip", typeof(object), typeof(IconHelper), new PropertyMetadata(null)); + #endregion + + #endregion } diff --git a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Properties/AssemblyInfo.cs b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Properties/AssemblyInfo.cs index 434ca78e..6ecfa459 100644 --- a/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Properties/AssemblyInfo.cs +++ b/DotNet/WPF/Src/SharedResources/Panuon.UI.Silver/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.2.15")] -[assembly: AssemblyFileVersion("2.2.15")] +[assembly: AssemblyVersion("2.2.15.1")] +[assembly: AssemblyFileVersion("2.2.15.1")]