A
asharda
Hi,
I am trying to create a context menu in my application. The context
menu takes menu otems from an XML file. In XAML the code is
<Grid.ContextMenu>
<ContextMenu Name="cm" StaysOpen="true" Width="Auto"
Height="Auto" ItemsSource="{Binding Mode=OneWay,
Source={StaticResource ListItemsDS}, XPath=/ListboxItems/ListboxItem/
ScreenName}" MenuItem.Click="add_Click">
</ContextMenu>
</Grid.ContextMenu>
The c# code for the even is
private void add_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("CLICKED " );
}
I am unable to get the value of the clicked item.
Any idea what I am doing wrong?
Thanks for your help in advance!
I am trying to create a context menu in my application. The context
menu takes menu otems from an XML file. In XAML the code is
<Grid.ContextMenu>
<ContextMenu Name="cm" StaysOpen="true" Width="Auto"
Height="Auto" ItemsSource="{Binding Mode=OneWay,
Source={StaticResource ListItemsDS}, XPath=/ListboxItems/ListboxItem/
ScreenName}" MenuItem.Click="add_Click">
</ContextMenu>
</Grid.ContextMenu>
The c# code for the even is
private void add_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("CLICKED " );
}
I am unable to get the value of the clicked item.
Any idea what I am doing wrong?
Thanks for your help in advance!