views:

124

answers:

1

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?

A: 

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.

Queso