I m 采用SL Prism和MEF,使用MVVER。
我的日志网页目前载有一个用户名和密码文本箱和一个单一日子。 我的纽特法典如下:
<Button x:Name="signInButton" Content="Sign In" cal:Click.Command="{Binding loginCommand}"/>
What I m struggling with is wiring up the textbox so that if the user hits enter the loginCommand executes. I ve done a lot of googling and can t seem to find any answers that cope with MVVM.
我试图在控制线上增加一个主要活动手。 然而,从我所能实现的唯一东西背后的法典来看,它把重点放在纽伦。
private void StackPanel_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
this.signInButton.Focus();
e.Handled = true;
}
}
我怎么能够达到要求执行标志的进入钥匙的目标?
Many Thanks James