1

My Application window contains Two regions i.e. left & right and i have defined a keybinding in view of left region which contains button and combobox. And this is not working as expected when you press key on application starts beause of focusing issue as we are not focusing left region (Works well if you set focus on that region by selecting combobox).

prawin
  • 413
  • 7
  • 16

2 Answers2

1

Yes, keybindings works only when View is focused. Since you have two Views, only one of them can be focused at once.

What you can do, is to define keybindings in parent view and publish event from parent view model to child view model which is subscribed to this event.

But if the problem is just about focusing left region when view is loaded, you should subscribe in xaml.cs file to Loaded event and set focus programatically.

yurislav
  • 1,119
  • 12
  • 17
0

You should try to navigate to view within "left" region after navigating to "right" region. It should solve your problem in simple way. If you can't do that then you could look at this question. I hope my answer helps :)

Community
  • 1
  • 1
Kapitán Mlíko
  • 4,498
  • 3
  • 43
  • 60