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.

image

 

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:

http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx

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

Screenshots

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

quickaccess

 

image

 

image

 

image

 

image

 

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.

<Window
  x:Class="Hardcodet.NetDrives.UI.SystemTray.Sample"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:tb="http://www.hardcodet.net/taskbar">

    <tb:TaskbarIcon x:Name="myNotifyIcon"
                    Visibility="Visible"
                    ToolTipText="Fallback ToolTip for Windows xp"
                    IconSource="/Images/TrayIcons/Logo.ico"
                    ContextMenu="{StaticResource TrayMenu}"
                    MenuActivation="LeftOrRightClick"
                    TrayPopup="{StaticResoure TrayStatusPopup}"
                    PopupActivation="DoubleClick"
                    TrayToolTip="{StaticResource TrayToolTip}"
      />

</Window>
  1. September 29th, 2014 at 09:27 | #1

    Hi,

    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

    @Rajeev
    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?

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