WPF MVVM 键盘按键事件绑定

<TextBox Text="{Binding LoginName}" Height="35" Canvas.Left="306" TextWrapping="Wrap" Canvas.Top="278" Width="293" BorderThickness="0" MaxLength="20">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DC_Login}"></KeyBinding>
</TextBox.InputBindings>
</TextBox>

 

posted @ 2020-02-27 09:56  jasonlai2016  阅读(2916)  评论(0编辑  收藏  举报