MVVM TextBox keyboard event, mvvmtextbox keyboard
In MVVM, The RichTextBox keyboard press ENTER event is set to send, not press ENTER
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>
Set: AcceptsReturn = "False". This means no line break.