Hi All,
I have a context menu situated inside a User Control Resource.
<UserControl.Resources>
<ContextMenu x:Key="Menu1">
<MenuItem Header="View/Edit Contact" Command="{Binding SearchCommand}" CommandParameter="editcontact"/>
<MenuItem Header="View/Edit Company" Command="{Binding SearchCommand}" CommandParameter="editprimarycompany"/>
</ContextMenu>
</UserControl.Resources>
This resource is bound to a WPF grid.
Now, after the grid is filled with data, I am right clicking on the grid. And I am able to find the context menu.
The problem is how can I know at runtime which menu item has been clicked?
I have tried with this
var t = this.TryFindResource("Menu1") as Style;
in the grid's SelectedItemsChanged event but it is null.
Please help me and also tell me in which event of grid should I will be able to acess this!
Thanks in advance.
I am using C#,WPF,Infragistics Control(WPF)