How do you use mvvm-light to trigger gotfocus
Using silverlight, we are looking to move the focus to a textbox. How do you use mvvm-light to trigger gotfocus? The view contains:
<TextBox Margin="4,4,0,0" Text="{Binding Path=SearchOID, Mode=TwoWay}">
<i:Interaction.Triggers>
<i:EventTrigger EventNa开发者_运维技巧me="GotFocus">
<cmd:EventToCommand Command="{Binding GotFocusCommand, Mode=TwoWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
- How should the ViewModel look?
- How do you trigger this from the ViewModel?
Ended up using a TriggerAction, very similar to: http://www.codeproject.com/Articles/42988/Silverlight-Behaviors-and-Triggers-Making-a-Trigge.aspx
精彩评论