Invoke Command When “ENTER” Key Is Pressed In XAML

后端 未结 5 413
花落未央
花落未央 2020-12-24 08:38

I want to invoke a command when ENTER is pressed in a TextBox. Consider the following XAML:



        
5条回答
  •  生来不讨喜
    2020-12-24 08:54

    On top of my mind.. You can pass event args to command and than in ViewModel check if e.KeyPress = Keys.Enter.. this is not really code :) i dont have my VS on this computer.. this is rather an idea :)

提交回复
热议问题