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>