user10594374
user10594374

Reputation: 53

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

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?

Upvotes: 2

Views: 1122

Answers (1)

Gerald Versluis
Gerald Versluis

Reputation: 34003

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.

Upvotes: 2

Related Questions