-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MenuFlyoutItem Click Events not beeing called #92
Labels
bug
Something isn't working
Comments
You can use ICommand or XamlUICommand interface instead. public NavigationPage()
{
this.InitializeComponent();
// Add Event Listener for the Command
Command.ExecuteRequested += Command_ExecuteRequested;
}
// Property with Instanciation
public XamlUICommand Command { get; set; } = new XamlUICommand();
// Example Event (exits that application)
private void Command_ExecuteRequested(XamlUICommand sender, ExecuteRequestedEventArgs args)
{
App.Current.Exit();
} Sample WinUI XAML <tb:TaskbarIcon
x:Name="TrayIcon"
ToolTipText="{StaticResource appName}"
TrayToolTip="{StaticResource appName}"
ContextMenuMode="SecondWindow"
IconSource="./../Assets/Icon1.ico"
>
<tb:TaskbarIcon.ContextFlyout>
<MenuFlyout AreOpenCloseAnimationsEnabled="False">
<MenuFlyoutItem Command="{x:Bind ShowHide}" Text="Show/Hide Window" />
<MenuFlyoutSeparator />
<MenuFlyoutItem Command="{x:Bind Command}" Text="Exit" />
</MenuFlyout>
</tb:TaskbarIcon.ContextFlyout>
</tb:TaskbarIcon> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
MenuFlyoutItem Click events not called in the app
Steps to reproduce the bug
Expected behavior
Events should be called
Screenshots
No response
NuGet package version
Platform
WinUI
IDE
Visual Studio 2022
Windows Version
Windows 11
WindowsAppSDK Version
Other
WindowsAppSDK Type
Other
Manifest
The text was updated successfully, but these errors were encountered: