Empower your app with a flyout for its tray icon in WinUI 2/3.
You can consume this project via NuGet. Use NuGet Package Manager or run the following command in the Package Manager Console:
> dotnet add package 0x5BFA.TrayIconFlyout.Uwp --prerelease
> dotnet add package 0x5BFA.TrayIconFlyout.WinUI --prerelease
There are two flyouts are available in this project. One is TrayIconFlyout for the Shell Flyout behavior, and the other is TrayIconMenuFlyout for the Context Menu behavior.
<me:TrayIconFlyout x:Class="..." ... Width="360">
<me:TrayIconFlyoutIsland Height="300">
<!-- Put elements here -->
</me:TrayIconFlyoutIsland>
<me:TrayIconFlyoutIsland Height="300">
<!-- Put elements here -->
</me:TrayIconFlyoutIsland>
</me:TrayIconFlyout>if (_trayIconFlyout.IsOpen)
_trayIconFlyout.Hide();
else
_trayIconFlyout.Show();<me:TrayIconMenuFlyout x:Class="..." ...>
<MenuFlyoutSubItem Text="Settings">
<MenuFlyoutSubItem.Icon>
<FontIcon Glyph="..." />
</MenuFlyoutSubItem.Icon>
<MenuFlyoutSubItem.Items>
<MenuFlyoutItem Text="Theme" />
<MenuFlyoutItem Text="Language" />
<MenuFlyoutItem Text="Privacy" />
</MenuFlyoutSubItem.Items>
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutItem Text="Exit">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="..." />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</me:TrayIconMenuFlyout>if (_trayIconMenuFlyout.IsOpen)
_trayIconMenuFlyout.Hide();
_trayIconMenuFlyout.Show(e.Point);- Prerequisites
- Windows 10 (Build 10.0.17763.0) onwards and Windows 11
- Visual Studio 2022
- .NET 9/10 SDK
- Clone the repo
git clone https://github.com/0x5bfa/TrayIconFlyout.git - Open the solution
- Build the solution