-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
fixed-in-8.0.0-preview.7.8842Look for this fix in 8.0.0-preview.7.8842!Look for this fix in 8.0.0-preview.7.8842!legacy-area-desktopWindows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls))Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls))p/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat π»this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't workingt/desktopThe issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Milestone
Description
Description
I can create a menu and use the accelerator api, however it doesn't do anything. I should be able to use this or similar to add keyboard shortcuts to menu items.
void InitMenu()
{
var fileMenu = new MenuBarItem { Text = "File" };
var exitItem = new MenuFlyoutItem
{
Text = "Exit",
Command = new Command((obj) =>
{
Application.Current.Quit();
})
};
MenuItem.SetAccelerator(exitItem, Accelerator.FromString("cmd+q"));
fileMenu.Add(exitItem);
var locationMenu = new MenuBarItem { Text = "Location" };
var changeItem = new MenuFlyoutItem
{
Text = "Change",
Command = new Command((obj) =>
{
Navigation.PushAsync(new ButtonPage());
})
};
locationMenu.Add(changeItem);
var refreshItem = new MenuFlyoutItem
{
Text = "Refresh"
};
MenuItem.SetAccelerator(refreshItem, Accelerator.FromString("cmd+r"));
locationMenu.Add(refreshItem);
this.MenuBarItems.Add(fileMenu);
this.MenuBarItems.Add(locationMenu);
}
Steps to Reproduce
Add the code above to a ContentPage, run it. Note no compiler error, and no keyboard support.
Version with bug
Release Candidate 1
Last version that worked well
Unknown/Other
Affected platforms
Windows, macOS
Affected platform versions
win11
Did you find any workaround?
No response
Relevant log output
No response
molesmoke, jeremy-visionaid, manfromarce, YBTopaz8, MartyIX and 1 more
Metadata
Metadata
Assignees
Labels
fixed-in-8.0.0-preview.7.8842Look for this fix in 8.0.0-preview.7.8842!Look for this fix in 8.0.0-preview.7.8842!legacy-area-desktopWindows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls))Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls))p/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat π»this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't workingt/desktopThe issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)