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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -