wpf - Context menu disappears when opened with Key.App -
i have small problem context menu in c#/wpf. open within canvas, being attached rectangle. have defined open space key, , works fine. want change app-key (aka menu-key, application-key, contxt-key, etc.). when press app-key, context menu appears, far release key, disappears. test case, tried key 'a', , works fine. know why disappears after releasing button? has key special behaviour?
here code:
private void rect_keydown(object sender, keyeventargs e) { if (e.key == key.space || e.key == key.a || e.key == key.apps) { e.handled = true; componentwithfocus.mainrectangle.contextmenu.isopen = true; } }
for have same problem, here solution: app-key should not handled in keydown event, has handled in keyup event.
br, ossi
Comments
Post a Comment