c# - How to execute main window key binding when child window is focussed in wpf? -


i have binded key binding wpf main window below,

<window.inputbindings>     <keybinding key="f2" command="{binding testcommand}"/> </window.inputbindings> 

normally executes fine. if new child window opened(currently focused) means, main window key binding not works.

i know, key binding execute focused item only, here want execute if not focused. way , if possible please share idea me.

this serious issue me.

any 1 please provide suggestion?

wpf behavior: global application shortcut keys

seems you're looking for. made couple small modifications author's code required functionality(rather passing in inputbindings collection, made behavior pick associatedobject directly. took out restriction requiring modifier keys, although suggest read through author's notes in article , incorporate requirements)

sample download requirements

^^ required behavior, go through behavior<t> see if can optimise better yourself(only bit's looked stuff relating specific requirement.)


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -