开发者

Add MenuItems to existing ContextMenu within a Style in XAML

开发者 https://www.devze.com 2023-03-18 05:29 出处:网络
I have a style for a control and I\'d like to add items to the context menu of that control. I was able to replace the context menu with my own but have found no way to add it开发者_C百科ems to the ex

I have a style for a control and I'd like to add items to the context menu of that control. I was able to replace the context menu with my own but have found no way to add it开发者_C百科ems to the existing one. Is this possible in XAML?

Thanks!


You can always toggle a MenuItem's visibility in XAML using bindings. This allows you to create one context menu but control the options displayed to the user entirely through XAML. This is what I've done in the past as it seems to be the easiest option.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号