I was wandering if someone could explain to me how I could do a conditional key binding (using 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
CanExecutepart handle that by not always returning true?