开发者

How do I change the context menu on a WPF ESRI Symbol at run time?

An ESRI Symbol has a ControlTemplate and in the ControlTemplate 开发者_如何学编程I can specify a ContextMenu, and that works fine. However, I need to change the ContextMenu (add, remove items) at run time. ControlTemplate.FindName doesn't work because Symbol is not a FrameworkElement. I also know about Graphic.MouseLeftButtonDown, but I want the context menu to appear at right click, if possible.

Any suggestions?


If you implement the ContextMenuOpening event on your control you can specify the contextmenu there. This way you can alter it as needed at runtime.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜