Added Global KeyUp Event which is passed to ViewModel
This commit is contained in:
@@ -19,6 +19,16 @@ public partial class MainWindow : Window
|
|||||||
DataContext = new MainWindowViewModel();
|
DataContext = new MainWindowViewModel();
|
||||||
Topmost = true;
|
Topmost = true;
|
||||||
Topmost = false;
|
Topmost = false;
|
||||||
|
|
||||||
|
this.KeyUp += OnKeyUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnKeyUp(object? sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (DataContext is MainWindowViewModel vm)
|
||||||
|
{
|
||||||
|
vm.GlobalKeyUpHandler(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MVVM like implementations burst the bounds -> implemented the old school way
|
// MVVM like implementations burst the bounds -> implemented the old school way
|
||||||
|
|||||||
Reference in New Issue
Block a user