H.NotifyIcon
H.NotifyIcon copied to clipboard
Click events do not work on PopupMenu mode
Describe the bug
I was not able to get Click events triggered in PopupMenu mode.
Win App R v1.3.3, or 1.4
Using the Command property the same behaviour can be achieved. Added description on how to use in the readme, so it is easy for others to use the ICommand method as an alternative
Steps to reproduce the bug
<UserControl x:Class="Namespace.View.TrayIconView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:tb="using:H.NotifyIcon" mc:Ignorable="d">
<tb:TaskbarIcon
x:Name="TrayIcon"
x:FieldModifier="public"
IconSource="ms-appx:///Assets/Red.ico"
ToolTipText="ToolTip"
NoLeftClickDelay="True"
ContextMenuMode="PopupMenu"
>
<tb:TaskbarIcon.ContextFlyout>
<MenuFlyout AreOpenCloseAnimationsEnabled="False">
<MenuFlyoutItem Click="ShowWindow" Text="Show Window" />
<MenuFlyoutSeparator />
<MenuFlyoutItem Click="ExitApplication" Text="Exit" />
</MenuFlyout>
</tb:TaskbarIcon.ContextFlyout>
</tb:TaskbarIcon>
2. In the xaml.cs define an appropriate event handler for the events
3. Run the app and click the menu
Expected behavior
The events are triggered
Screenshots
No response
NuGet package version
No response
Platform
WinUI
IDE
Visual Studio 2022
Windows Version
Windows 10
WindowsAppSDK Version
Other
WindowsAppSDK Type
Unpackaged
Manifest
No response
Additional context
No response