diff --git a/README.md b/README.md index 052d050..c8e2e87 100644 --- a/README.md +++ b/README.md @@ -50,3 +50,9 @@ The sample below shows some of the properties of the control. For a more compreh ``` +## Contributors and Thanks + +Hi, I'm Philipp! This little library was originally written by me, but is currently mostly maintained by [Jan Karger](https://github.com/punker76) and [Robin Krom](https://github.com/Lakritzator). Big, big kudos to the two of you, and everybody else who [contributed](https://github.com/hardcodet/wpf-notifyicon/graphs/contributors) to this library. You rock! + +Make sure to check out Robin's great [Greenshot](https://getgreenshot.org/) tool (that I use on a daily basis), and Jan's [MahApps](https://github.com/MahApps) UI framework. + diff --git a/src/NotifyIconWpf/TaskbarIcon.Declarations.cs b/src/NotifyIconWpf/TaskbarIcon.Declarations.cs index 2e994f3..6cc4e37 100644 --- a/src/NotifyIconWpf/TaskbarIcon.Declarations.cs +++ b/src/NotifyIconWpf/TaskbarIcon.Declarations.cs @@ -247,6 +247,46 @@ private void OnIconSourcePropertyChanged(DependencyPropertyChangedEventArgs e) if (!Util.IsDesignMode) Icon = newValue.ToIcon(); } + #endregion + + #region IconInMemory + + /// + /// Updates the property. + /// + public static readonly DependencyProperty IconInMemoryProperty = + DependencyProperty.Register(nameof(IconInMemory), + typeof(Icon), + typeof(TaskbarIcon), + new FrameworkPropertyMetadata(null, IconInMemoryPropertyChanged)); + + /// + /// A property wrapper for the + /// dependency property:
+ /// Updates the property. + ///
+ [Category(CategoryName)] + [Description("Sets the displayed taskbar icon.")] + public Icon IconInMemory + { + get { return (Icon)GetValue(IconInMemoryProperty); } + set { SetValue(IconInMemoryProperty, value); } + } + + private static void IconInMemoryPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + TaskbarIcon owner = (TaskbarIcon)d; + owner.OnIconInMemoryPropertyChanged(e); + } + + private void OnIconInMemoryPropertyChanged(DependencyPropertyChangedEventArgs e) + { + Icon newValue = (Icon)e.NewValue; + + //resolving the ImageSource at design time is unlikely to work + if (!Util.IsDesignMode) Icon = newValue; + } + #endregion #region ToolTipText dependency property @@ -1893,4 +1933,4 @@ static TaskbarIcon() ContextMenuProperty.OverrideMetadata(typeof (TaskbarIcon), md); } } -} \ No newline at end of file +}