How to add visibility binding for MenuItem of ContextActions of a ListView

随声附和 提交于 2020-03-03 09:09:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!