c# - WPF DataGrid: How to prevent auto change row on enter key pressed? -
i'm using mvvm pattern in wpf project, i'm facing problem title mentioned. found suggestions use keyeventargs.handled = true;
this:
private void previewkeydown(object sender, keyeventargs e) { if ((e.key.equals(key.enter)) || (e.key.equals(key.return))) { e.handled = true; } }
but want write in viewmodel not code-behind of view. example shows way handle key event mvvm pattern don't know how pass keyeventargs
parameter use.
can can me? best way that?
any recommendation or suggestion appreciated.
thanks in advance.
Comments
Post a Comment