问题
I am trying display context actions menu items while selecting any listview item, there I have added three menu items. But I need to bind the visibility for those Menu Items. Depending on selection the specific menuitem should be visible. Is there any way to add binding for the contextActions menuitems in a listview?
回答1:
Since a ContextAction
is a MenuItem this is not possible. The MenuItem
does not expose any (bindable) IsVisible
property or alike.
A hacky workaround could be to add/remove context actions whenever you determine what needs to be shown or hidden. Or use the IsEnabled
property that is available.
来源:https://stackoverflow.com/questions/59581927/how-to-add-visibility-binding-for-menuitem-of-contextactions-of-a-listview