Open grokys opened 4 years ago
I have no preference either way - the only reason I implemented it like that was to mirror WPF naming and behavior, as you can mark the event as handled through its args. This has the same effect as cancelling it.
As for why it wasn't done as a routed event - I can't remember, but most likely lack of skill back then.
I agree that unifying the naming is a good aim, but it would introduce additional work for people porting from WPF.
Also, ToolTip events https://github.com/AvaloniaUI/Avalonia/pull/15493
The following events are available on
Menu
/ContextMenu
:MenuBase.MenuOpened
ContextMenu.ContextMenuOpening
ContextMenu.ContextMenuClosing
I see a few issues here:
MenuOpened
event is inherited byContextMenu
meaning that its open event has theMenu
prefix but its opening event has theContextMenu
prefixClosing
event needed? I've never seen a context menu that can't be closed, and having one sounds like a problemOpening
event onMenu
too (though it shouldn't be cancelable)I suggest the following;
MenuBase
hasOpened
andClosed
ContextMenu
has a cancelableOpening
Menu
has a non-cancelableOpening
ContextMenu
@WojciechKrysiak you implemented
ContextMenuOpening
/Closing
- what do you think?