开发者

Conditional Keybinding

I was wandering if someone could explain to me how I could do a conditional key binding (u开发者_JAVA百科sing an MVVM pattern), at the moment I have

 <Window.InputBindings>
    <KeyBinding Command="{Binding Path=CMD_Login}" Gesture="Enter" />
</Window.InputBindings>

but I would like this key-binding to only be active if the user is logging in. They login window is set to visible/collapse depending if the user is logging in or not, so was wandering if the conditional can possibly be based on that?

Thank You


If you have a command, shouldn't the CanExecute part handle that by not always returning true?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜