I have a menu in wpf that has an input box and a button on it. Once the user clicks the button I need to close the menu.
Is there a way to do this?
Get hold of the MenuItem and do:
MenuItem
_menuItem.IsSubmenuOpen = false;
Easy way to get hold of it:
Code-behind:
_button.Click += delegate { (_button.Tag as MenuItem).IsSubmenuOpen = false; };