-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
I would like to assign a command to a MenuFlyoutItem to enable or disable it at runtime (i.e., when the owning MenuBarItem is about to open):
let formatBoldItem = MenuFlyoutItem()
formatBoldItem.command = FormatBoldCommand()
where FormatBoldCommand would be something like
import WinUI
import WindowsFoundation
final class FormatBoldCommand: ICommand {
func canExecute(_ parameter: Any!) throws -> Bool {
return ...
}
func execute(_ parameter: Any!) throws {
}
lazy var canExecuteChanged: Event<EventHandler<Any?>> = ...
}I see ICommand is implemented for example in
public enum __IMPL_Microsoft_UI_Xaml_Input {
...
fileprivate class ICommandImpl: ICommand, WinRTAbiImpl {and was wondering if that's something that's also possible in user code?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels