WPF: context menu help

G

Griff

Hi

I have a context menu with several menu items. When the user selects the
menu item they want, then I obviously want to identify which menu item was
selected.

I've managed to handle the event that fires when the context menu closes,
but can't seem to identify which sub-menu item was selected.

Any suggestions?

Thanks

Griff
 
H

hbrower

You might try handling the menu click event rather than the closing event. Eg:

void menu_Click(object sender, RoutedEventArgs e)
{
MenuItem mi = sender as MenuItem;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top