<TextBox HorizontalAlignment="Left" Height="76" Margin="0,378,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="483" Text="{Binding test
,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True">
<TextBox.InputBindings>
<KeyBinding Key="Return" Modifiers="Shift"></KeyBinding>
<KeyBinding Key="Return" Command="{Binding command}"></KeyBinding>
</TextBox.InputBindings>
<TextBox.InputBindings>
<KeyBinding Key="Return" Modifiers="Shift"></KeyBinding>
<KeyBinding Key="Return" Command="{Binding command}"></KeyBinding>
</TextBox.InputBindings>
</TextBox>
换行设置AcceptsReturn="True"
AcceptsReturn的默认响应key为回车键(Enter),如果想改成其他键盘如下设置
<TextBox.InputBindings>
<KeyBinding Key="Return" Modifiers="Shift"></KeyBinding> 改成shift+enter
<KeyBinding Key="Return" Command="{Binding command}"></KeyBinding> enter触发后台方法.command为后台binding方法(一定要加上红色字体)。
</TextBox.InputBindings>