Added Global KeyUp Event which is passed to ViewModel

This commit is contained in:
Ano-sys
2025-03-23 00:24:06 +01:00
parent e811a54c61
commit da3dc87ed3
+10
View File
@@ -19,6 +19,16 @@ public partial class MainWindow : Window
DataContext = new MainWindowViewModel();
Topmost = true;
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