Replies: 1 comment
-
NativeMenu is one of the most cryptic things in avalonia |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
Slightly as a follow-up to this question, I was hoping someone could elaborate on the different uses of
NativeMenu
in Avalonia apps as of 10.x/11 - as it seems things have moved on a bit since some of the answers I could find were written.What exactly are the rules for including a
NativeMenu
in an application? (I'm interested specifically in desktop apps, and I'm assuming that's pretty much the limit of theNativeMenu
...?)More specifically:
App.axaml
andMainWindow.axaml
(or equivalents), included under<NativeMenu.Menu>
as a child of<Application>
and<Window>
, respectively. Are these still appropriate locations?NativeMenu
in the<Application>
versus the<Window>
?NativeMenu
objects in their AXAML? How does this relate to the main "application" drop-down menu seen on MacOS (i.e. the one that is usually boldfaced containing the application name)?NativeMenu
used under<TrayIcon.Menu>
in<Application>
. What operating systems does this work with? Can this also be used with<Window>
? Will this cause the menu to only appear as a context menu of the tray icon, or will it also appear in the system bar (as for MacOS)?Menu
with the standard "File"/"Edit"/"View" etc in myMainWindow.axaml
, the structure of which is mimicked in aNativeMenu
(placed somewhere, as above). Only one of these menus should be visible on the application, so what do I bind theIsEnabled
/IsVisible
properties of theWindow
'sMenu
to? I'm assuming it's somehow related toIsNativeMenuExportedProperty
?Menu
/NativeMenu
mimic each other in terms of content, so they don't have to be maintained separately? I could imagine writing a script to convert aMenu
into aNativeMenu
(throwing away icons and the like), but is this a good approach?NativeMenuItem
objects supportItemsSource
equivalents for dynamically adjusting content?<NativeMenu>
?<NativeMenu>
?(The docs could possibly do with improving in this area, as they don't discuss what kinds of controls NativeMenu can be included with, other than that it can be placed inside a tray icon.)
Any wisdom on the matter is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions