WPF: context menu help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Griff

    WPF: context menu help

    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


  • =?Utf-8?B?aGJyb3dlcg==?=

    #2
    RE: WPF: context menu help

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

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


    "Griff" wrote:
    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
    >
    >
    >

    Comment

    Working...