Here is the xaml for the contextMenu:
<Window.Resources>
<ContextMenu x:Key="IBContextMenu" x:Shared="true" Name="IBContextMenu1">
<MenuItem Header="Edit" Click="ibEdit_Click" AllowDrop="False" />
<MenuItem Header="Clear" Click="ibClear_Click"/>
</ContextMenu>
</Window.Resources>
Both the edit and clear items’ methods need to know which label to act upon. How can I do this?
I think you are looking for
PlacementTarget:http://msdn.microsoft.com/en-us/library/system.windows.controls.contextmenu.placementtarget.aspx
If you switch over to a Command-pattern, you can actually get this via Binding and pass it along as the CommandParameter…