M
M
Melz2018-04-03 21:15:49
WPF
Melz, 2018-04-03 21:15:49

WPF, who made global shortcuts without breaking MVVM?

Good afternoon,
I'm interested in an example or other help on global shortcuts for the program, those Ctrl + 1 should launch something from the VM.
I did this on WinForms and everything is simple there.
But I did not find an implementation (without strange perversions) for WPF. What you want:
1. Without code-behind. Those code should be in ViewModel or as Attached via Behaviour.
2. Actually global, irrespective of UserControl in which focus.
3. Dynamic. Those do not require a restart of the control. The user registered a hotkey in the form, clicked OK and it should work.
Point 3 seems to be the most difficult.
There should be an easy way, but the Internet is full of implementations through commands where everything is written in XAML.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2018-04-04
@AlexanderYudakov

It looks like an acute unwillingness to learn materiel.
KeyGesture, ICommand, KeyBinding, CommandBinding - you will have to figure out what it is and why it is needed.
https://docs.microsoft.com/en-us/dotnet/framework/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question