WPF NotifyIcon

October 26th, 2014


Version 1.0.5 released Nov 23th. (v1.1 is on the way – come back soon!)

This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich ToolTips, Popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.



Browse/fork/clone Git repository
Download Control & Sample Application
Download via NuGet

(Latest release: 1.0.5, 2013.11.23)



Features at a glance

  • Custom Popups (interactive controls) on mouse clicks.
  • Customized ToolTips (Vista and above) with fallback mechanism for xp/2003.
  • Rich event model including attached events to trigger animations in Popups, ToolTips, and balloon messages. I just love that.
  • Full support for standard Windows balloons, including custom icons.
  • Custom balloons that pop up in the tray area. Go wild with styles and animations :)
  • Support for WPF context menus.
  • You can define whether to show Popups on left-, right-, double-clicks etc. The same goes for context menus.
  • Simple data binding for Popups, ToolTips and custom balloons through attached properties and derived data context.
  • Command support for single / double clicks on the tray icon.

Tutorial and Support

        A comprehensive tutorial that complements the attached sample application can be found on the Code Project:


Please post support questions to the CodeProject forum only. Thank you.


The screenshots below were taken from NetDrives and the sample application.











XAML Declaration Sample

The sample below shows some of the properties of the control. For a more comprehensive sample, have a look at the sample application that comes with the download.


    <tb:TaskbarIcon x:Name="myNotifyIcon"
                    ToolTipText="Fallback ToolTip for Windows xp"
                    ContextMenu="{StaticResource TrayMenu}"
                    TrayPopup="{StaticResoure TrayStatusPopup}"
                    TrayToolTip="{StaticResource TrayToolTip}"

  1. September 29th, 2014 at 09:27 | #1


    Your library is great and very helpful, thanks!

    But it would be much better if you could host it on GitHub, because currently there is no easy way to see what has changed between one version and the next. I had to make a few changes to fix bugs or adapt it to my needs, but if I get the latest update from you, I have to reintegrate my changes manually, which is a pain… If it was on GitHub I could just fork the repo, make my changes (and possibly make a pull request for you to integrate them), and pull from your repo to merge your latest changes automatically.

  2. Rajeev
    October 1st, 2014 at 19:36 | #2

    I am having issue where if task bar icon is created pro grammatically or by using resource then clicking of tray icon doesn’t show context menu on top of icon. I see same issue with sample app (windowless sample)

  3. Rajeev
    October 2nd, 2014 at 02:04 | #3

    So I found out that this problem arise when you change screen resolution > make text or other items larger and smaller and then increase size from default to medium. However, this problem doesn’t occur when u create taskbar icon using window xaml

  4. October 11th, 2014 at 14:25 | #4

    Great control! Been using it for a couple years in several projects. I’m having a problem where once the context menu has been activated on the tray icon, the context menu will not display at any other location when invoked by other controls. It continues to display in the location it did when it was invoked by the tray icon. Is this an issue with wpfNotifyIcon?

  5. November 2nd, 2014 at 01:13 | #5

    I like the helpful information you provide in your
    articles. I’ll bookmark your weblog and check again here regularly.
    I am quite sure I’ll learn many new stuff right here!
    Best of luck for the next!

  6. November 9th, 2014 at 15:55 | #6

    This library is great. Good job.
    I have one question. How can I show custom balloon without closing actual balloon?
    I use tryicon for showing new message in my chat application and I want show all new message as custom balloon.
    Can you help me?

  7. Kristian
    November 29th, 2014 at 07:14 | #7

    Having trouble with the IconSource. I can do this ok…

    but I can’t do this…

    I get an exception…

    An exception of type ‘System.ArgumentException’ occurred in Hardcodet.Wpf.TaskbarNotification.dll but was not handled in user code

    Additional information: The supplied image source ‘pack://application:,,,/KcTrayApp;component/Images/Kc_16x16.png’ could not be resolved.

    My image is set as content & copy always. Visual Studio 2013 update 4, used nuget to obtain notifyicon.


  8. Kristian
    November 29th, 2014 at 07:30 | #8

    Having trouble with the IconSource. I can do this ok…

    <Image Source="Images/Kc_16x16.png" />

    but I can’t do this…

    ToolTipText="blah blah" />

    I get an exception…

    An exception of type ‘System.ArgumentException’ occurred in Hardcodet.Wpf.TaskbarNotification.dll but was not handled in user code

    Additional information: The supplied image source ‘pack://application:,,,/KcTrayApp;component/Images/Kc_16x16.png’ could not be resolved.

    My image is set as content & copy always. Visual Studio 2013 update 4, used nuget to obtain notifyicon.

    Sorry about the previous post – hopefully the xaml is escaped properly now.


  9. Kristian
    November 29th, 2014 at 07:32 | #9

    I used an online tool to quicky escape the xaml. Pretty handy…

  10. Kristian
    November 29th, 2014 at 07:56 | #10

    So, I’ve found out how to get it to work. The image must be an ico, as a png will not work and the settings must be resource + do not copy. Using content + copy always does not work.

  11. Ricardo Figueiredo
    December 2nd, 2014 at 15:01 | #11

    great Library!!!

    I am facing an issue related to display of Balloon as it appears overriding taskbar… In your original sample it is shown correctly above taskbar but I seem unable to replicate it. What could I been missing?

  12. ptaylor
    December 2nd, 2014 at 15:49 | #12

    Do you have an example where you bind the IconSource property to a viewmodel using a .ico file? I am struggling to set it up properly. Thanks for the great toolbar icon.

  13. Krishna
    January 9th, 2015 at 05:13 | #13

    I am facing issue while integrating notifyicon with windows service. Always i used to get the error unable to find appbar that matches the given criteria.
    I have create on exe when you double click on exe it will show notification. By double clicking this works.
    But when i make this exe to run as scheduler again i am getting error unable to find appbar that matches the given criteria.

    Please Let me know where i have done the mistake ?

  14. Krishna
    January 9th, 2015 at 12:19 | #14

    Solved Issue i have posted this sanghimz.blogspot.com
    Reason i was getting error because library was unable to find the Window in Windows 7 due to change in application session and windows service session

  15. John
    January 16th, 2015 at 16:46 | #15

    I create an icon that when running on Citrix has visibility set to collapsed. If my citrix client gets disconnected then reconnects to the same station, I get the icon appearing. Any idea why or suggested fixes? Upon normal operation, no icon appears from citrix(which is what i want)

  16. Alexander
    January 21st, 2015 at 11:37 | #16

    And what was the fix?

  17. Umut
    February 12th, 2015 at 09:35 | #17

    I have an issue with Windows 8.x. When notify icons are grouped context menu is showed at wrong coordinates.
    Is this a known issue and any plans to fix it?

  18. abbaty48
    July 9th, 2015 at 13:32 | #18

    please how can i use this in my 3.5 .net project

  19. July 19th, 2015 at 11:04 | #19

    Some of the win8 users of my application are having troubles with the NotifyIcon since Thursday (maybe caused by a windows update?).
    Anyone else having similar problems?

    I don’t have win8, but from the Backtrace the users sent me it looks like a problem with the interop helper.

    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund eines Ausnahmefehlers beendet.
    Ausnahmeinformationen: System.ArgumentException
    bei System.Windows.Media.CompositionTarget.SetRootVisual(System.Windows.Media.Visual)

    bei System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty, System.Object)
    bei Hardcodet.Wpf.TaskbarNotification.TaskbarIcon.OnToolTipChange(Boolean)
    bei Hardcodet.Wpf.TaskbarNotification.Interop.WindowMessageSink.ProcessWindowMessage(UInt32, IntPtr, IntPtr)
    bei Hardcodet.Wpf.TaskbarNotification.Interop.WindowMessageSink.OnWindowMessageReceived(IntPtr, UInt32, IntPtr, IntPtr)

  20. July 29th, 2015 at 20:04 | #20

    Hello, I’m curious if you or perhaps anybody else here has seen the issue I’m seeing when trying to deploy. The application crashes on startup with the following debug information:

    ‘Set connectionId threw an exception.’ Line number ‘6’ and line position ‘9’.

    Could not load file or assembly ‘Hardcodet.Wpf.TaskbarNotification, Version=, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

    at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
    at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
    at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
    at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
    at IronMan_UpdateService.MainWindow.InitializeComponent()
    at IronMan_UpdateService.MainWindow..ctor()

  21. esurface
    August 3rd, 2015 at 15:56 | #21

    Any update on this? I have the same issue.

  22. Antonio
    August 10th, 2015 at 16:08 | #22

    Hi Philipp,

    I’m a developer in China. I just want to say your library is great. At the same time, is it possible to ask your permission to use your Hardcodet WPF notifyicon on my software product (commercial)?



  23. elbxs
    August 15th, 2015 at 01:03 | #24

    If you set the “visibility” property to false, the icon will flash briefly. Will there be a fix for this in a future patch, or is there a proper method of hiding the tray icon?

    (The reason I hide the icon, is that I have a “Tray Icon” option. If the user doesn’t want the icon, they can disable it.)

  24. Joe
    August 24th, 2015 at 23:30 | #25

    Apologies as I must be in error since I haven’t seen this come up; but I have not been able to set:
    – InitialShowDelay
    – ShowDuration
    – BetweenShowDelay

    via the tooltip service. I can set the vertical/horizontal offsets, so I’m not totally messed up. I’ve tried code and xaml. Has anyone had luck with these?

  25. Imtiaz
    September 1st, 2015 at 10:58 | #26

    I have been using your library for a while, and now we have localized our software.
    The balloon text is visible in all languages, but in Chinese/Korean etc it shows “?”
    Are you escaping non-ASCII characters?

  26. Rony
    September 19th, 2015 at 15:00 | #27


    How can I force the popup to stay up even though it loses focus?


  27. Brent Scriver
    October 23rd, 2015 at 00:01 | #28

    Hi, I have some deltas I would love to push back for supporting using the Guid for click once applications and to support the ContextMenuStrip for Forms (helps bridge the transition from Forms to WPF). I see there are a couple of forks on Github already.

  28. Joerg
    October 29th, 2015 at 06:42 | #29

    Hello Philipp,

    is this project still alive? I have been waiting for 1.1 for a very long time. Version 1.0.5 produces access violations when I try to show an OpenFileDialog in my App. So I’ve been stuck on 1.0.4, which has some other weird issues sometimes.
    I also could not find the original repository on GitHub. Any ieda?

Comment pages
1 3 4 5 452
  1. May 11th, 2009 at 13:45 | #1
  2. May 26th, 2009 at 18:13 | #2
  3. June 1st, 2009 at 00:52 | #3
  4. June 24th, 2009 at 18:37 | #4
  5. August 4th, 2009 at 06:13 | #5
  6. October 18th, 2009 at 11:00 | #6
  7. October 26th, 2009 at 23:43 | #7
  8. March 11th, 2010 at 17:18 | #8
  9. May 6th, 2010 at 21:18 | #9
  10. May 19th, 2010 at 12:44 | #10
  11. May 27th, 2010 at 14:26 | #11
  12. February 26th, 2011 at 20:07 | #12
  13. September 27th, 2011 at 07:25 | #13
  14. September 27th, 2011 at 07:29 | #14
  15. February 2nd, 2012 at 04:03 | #15
  16. April 28th, 2012 at 14:37 | #16
  17. June 27th, 2012 at 20:06 | #17
  18. November 21st, 2012 at 03:39 | #18
  19. September 3rd, 2013 at 02:02 | #19
  20. October 18th, 2013 at 10:35 | #20
  21. March 10th, 2014 at 10:13 | #21
  22. March 14th, 2014 at 13:57 | #22
  23. July 9th, 2015 at 02:50 | #23