This commit is contained in:
NaBian 2020-09-18 23:41:10 +08:00
parent 0ec7532ad0
commit d1f6b5f7a0

View File

@ -270,6 +270,11 @@ namespace HandyControl.Controls
var ctl = (NotifyIcon)d;
ctl._icon = (ImageSource)e.NewValue;
ctl.OnIconChanged();
if (!string.IsNullOrEmpty(ctl._windowClassName) && !ctl.IsBlink && ctl.Visibility == Visibility.Visible)
{
ctl.UpdateIcon(true);
}
}
public ImageSource Icon
@ -491,6 +496,8 @@ namespace HandyControl.Controls
private void OnIconChanged()
{
if (_windowClassName == null) return;
if (_icon != null)
{
IconHelper.GetIconHandlesFromImageSource(_icon, out _, out _iconHandle);