开发者

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>
  1. How should the ViewModel look?
  2. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜