For your specific example, you can make use of InputBindings
. These allow you to execute some command in reaction to gestures (usually keyboard or mouse). Here is a quick example to achieve what you are after:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Row="1" TextWrapping="Wrap" Text="{Binding CurrentMessage, UpdateSourceTrigger=PropertyChanged}">
<TextBox.InputBindings>
<KeyBinding Command="{Binding SendMessageCommand}" Key="Return" />
<KeyBinding Command="{Binding SendMessageCommand}" Key="Enter" />
</TextBox.InputBindings>
</TextBox>
<Button Content="Send" Grid.Column="1" Grid.Row="1" Command="{Binding SendMessageCommand}"/>
</Grid>
For more advanced situations, such as reacting to various UI events, you can make use of Expression Blends Interactivity namespace (see here):
<TextBox>
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<i:EventTrigger.Actions>
<i:InvokeCommandAction Command="{Binding SendMessageCommand}" />
</i:EventTrigger.Actions>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
An unofficial version of the Blend SDK can be found on NuGet here.