MVVM TextBox的键盘事件

MVVM下RichTextBox的键盘回车事件设置为发送,不是回车

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mv="http://www.galasoft.ch/mvvmlight"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
<controls:BindableRichTextBox x:Name="rtb" Document="{Binding ShowSendMessage,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Grid.Row="1" Background="#FFF9F9F9" Focusable="True" Margin="10,0" BorderThickness="0" AcceptsReturn="False">
<i:Interaction.Triggers>
<ei:KeyTrigger FiredOn="KeyUp" Key="Enter">
<mv:EventToCommand Command="{Binding SendCommand}"/>
</ei:KeyTrigger>
</i:Interaction.Triggers>
</controls:BindableRichTextBox>
设置:AcceptsReturn="False" 这个就是不换行
上一篇:Spring MVC 分离了控制器、模型对象、过滤器以及处理程序对象的角色


下一篇:SpringMVC初步