Hi
How can two infragistics controls share the same context menu. Say, I have xamdatatree and xamdiagram in a window and I wanted to have same context menu for both controls?
Thanks.
Hello Abs,
In order to have the XamDiagram and the XamDataTree share essentially the same context menu, I would recommend defining your XamContextMenu as a resource and giving it an x:Key. This will allow you to access it by the key that you give it when you set up the ContextMenuManager needed to apply your XamContextMenu to a particular control. The ContextMenuManager has a ContextMenu property, and by defining your XamContextMenu as a resource, you can apply it using a StaticResource. An example XamDiagram using this method could look like the following:
<ig:XamDiagram> <ig:ContextMenuService.Manager> <ig:ContextMenuManager ContextMenu="{StaticResource contextMenu}"/> </ig:ContextMenuService.Manager></ig:XamDiagram>
I have attached a sample project to demonstrate the above. I hope this helps.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thanks, it works as expected.