What I want is simply that all my TextBoxes as by default set their cursor at the end of the text so I want in pseudocode:
if (TextChanged) textbox.SelectionStart = textbox.Text.Length;
Because I want that all textboxes in my application are affected I want to use a style for that. This one won't work (for obvious reasons) but you get the idea:
<Style TargetType="{x:Type TextBox}">
<Style.Triggers>
<EventTrigger RoutedEvent="TextChanged">
<EventTrigger.Actions>
<Setter Property="SelectionStart" Value="{Binding Text.Length}"/>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
EDIT: One important thing is that the SelectionStart property should only be set if the Text property was assigned programmatically, not when the user edits the textbox.