【问题标题】:Force TextBox to lost focuse when EventToCommand firedEventToCommand 触发时强制 TextBox 失去焦点
【发布时间】:2014-01-08 21:14:09
【问题描述】:

我需要登录。我将登录绑定到我的 ViewModel。我无法从 passwordBox 绑定密码,所以我通过 EventToCommand 参数传递它

 <i:Interaction.Triggers>
      <i:EventTrigger EventName="Tap">
        <cmd:EventToCommand Command="{Binding LogInCommand,
                                      Mode=OneWay}"
                            CommandParameter="{Binding Password,
                              ElementName=PasswordBox,
                              Mode=OneWay}"
                            />
      </i:EventTrigger>
    </i:Interaction.Triggers>

我的问题 - 当登录框具有焦点时,ViewModel 中的登录为空。点击按钮时如何强制失去焦点。

【问题讨论】:

    标签: mvvm windows-phone-8 eventtocommand


    【解决方案1】:

    我知道这不完全是您问题的答案,但仍然...... 您可以在此处找到使用 MVVM 实现登录对话框 http://www.geoffhudik.com/tech/2012/2/19/windows-phone-login-navigation.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多