I m new to WPF and in an application i m building I d like to show the main menu when the alt key is pressed just like windows explorer in vista and windows 7. I ve tried using a keybinding with just the modifier set but that doesn t seem to work.
Heres by code so far:
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:MainWindow.ShowMenuCommand}"
CanExecute="ShowMenuCommand_CanExecute"
Executed="ShowMenuCommand_Executed"/>
</Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Key="Alt" Command="{x:Static local:MainWindow.ShowMenuCommand}" />
</Window.InputBindings>
I d also like the menu to disappear when the focus is lost.
Any ideas?