I have to assign ShortCut Keys to open a window in a WPF application(MVVM Pattern).The shortcut key should work from any window in my application. These keys should work in application level and shouldn't be global. Could anyone please help me with this?
What I have tried:
I've tried Importing User32.dll and RegisterHotKey method. But, this assigns key globally. Even If I've minimized my application and press any shortcut key, the assigned window gets open.
[DllImport("user32.dll")]
static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers,int vk);