There is a newer version of this package available.
See the version list below for details.
dotnet add package TrayIcon --version
NuGet\Install-Package TrayIcon -Version
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrayIcon" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TrayIcon --version
#r "nuget: TrayIcon,"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TrayIcon as a Cake Addin
#addin nuget:?package=TrayIcon&version=

// Install TrayIcon as a Cake Tool
#tool nuget:?package=TrayIcon&version=

Tray Icon

Library that allows use Tray Icon in WPF Application. Ported from Windows Forms. Has wrapper for WPF ContexMenu (which converts it to Windows Forms ContextMenu). This is needed for good performance, and compatibility. This library targets all MVVM requirements:

  • it has bindable properties
  • it has interface with notify methods

Patch details (1.0.6.*)

  • Added ability to set default menu item.
  • Reworked IconSource property. Now it can be set the same way as Window.Icon property.

Getting started.

First you need to include namespace to your code or markup.

For XAML it can look like:

<Window xmlns:icon="" />

And for C#:

using NullSoftware.ToolKit;

Then you can place tray icon inside your window, or keep it in variable/property. For XAML:

    <icon:TrayIcon Title="My Application"
                   ClickCommand="{Binding ExampleCommand}"

For C#:

TrayIcon MyTrayIcon = new TrayIcon() 
    Title = "My Application",
    IconSource = new BitmapImage(new Uri("pack://application:,,,/MainIcon.ico")),
    ClickCommand = new RelayCommand(ExampleAction)

To show balloon you need to call Notify method:

INotificationService notifyService = MyTrayIcon;
notifyService.Notify("Greetings", "Hello World!", NotificationType.Information);

Note: INotificationService can be obtained from XAML by using NotificationServiceMemberPath. It injects INotificationService to specified DataContext property.

Full Example:

<Window x:Class="TrayIcon.Example.MainWindow"
        Height="450" Width="800"

        <icon:TrayIcon Title="My Application"
                       DoubleClickCommand="{Binding MinimazeCommand}"
                    <MenuItem Header="Notify" Command="{Binding SayHelloCommand}" icon:TrayIcon.IsDefault="True"/>
                    <MenuItem Header="_Silent Mode" IsCheckable="True" IsChecked="{Binding IsSilentModeEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                    <MenuItem Header="E_xit" Command="{Binding CloseCommand}"/>

        <StackPanel VerticalAlignment="Top"
                    Margin="10, 20"
            <CheckBox VerticalAlignment="Center"
                      IsChecked="{Binding IsSilentModeEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                      Content="Silent Mode"/>
            <Button Margin="20, 0, 0, 0"
                    Padding="10, 3"
                    Command="{Binding SayHelloCommand}"

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
.NET Framework net45 is compatible.  net451 is compatible.  net452 is compatible.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.7.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated 177 3/13/2024 206 2/11/2024 83 2/10/2024
1.1.0 106 2/10/2024 12,060 3/12/2022 383 3/11/2022
1.0.7 383 3/11/2022
1.0.7-preview 141 3/11/2022 399 3/9/2022
1.0.6 384 3/9/2022 379 3/9/2022
1.0.5 384 3/9/2022 279 11/18/2021
1.0.4 248 11/18/2021
1.0.3 262 10/6/2021
1.0.2 328 10/3/2021
1.0.1 353 10/3/2021
1.0.0 438 10/3/2021

Added descriptions for properties in XAML Designer.
Added support for .NET Framework 4.7 (was missed).