It could be interesting to attach a command to a TextBox if the enter key is pressed while the TextBox is focused so to provide a better UX to the end user, the TextBoxManager Command attached property (or behavior) comes to the rescue in this scenario:

<TextBox Text="bla bla...">
    <i:Interaction.Behaviors>
        <behaviors:TextBoxCommandBehavior Command="{Binding Path=MyCommand}" />
    </i:Interaction.Behaviors>
</TextBox>

<TextBox Text="bla bla..." behaviors:TextBoxManager.Command="{Binding Path=MyCommand}" />

the attached property, and the behavior too, is defined in the “http://schemas.topics.it/wpf/radical/windows/behaviors” xml namespace.

Last edited Jun 15, 2013 at 5:02 PM by topics, version 2

Comments

No comments yet.