http://*.com/questions/2444927/wpf-prism-canexecute-method-not-being-called
It is most likely that the bound control is never asking for the CanExecute state again. You need to call the RaiseCanExecuteChanged method on the DelegateCommand whenever you detect a condition that changes the command's CanExecute state. This signals the bound control to update theCanExecute state.
solution
private void RaiseCanExecuteChanged()
{
DelegateCommand<object> command = LoginCommand as DelegateCommand<object>;
command.RaiseCanExecuteChanged();
} public const string UsernameProperty = "Username";
private String _username;
public String Username
{
get { return _username; }
set
{
_username = value;
this.NotifyPropertyChanged(UsernameProperty);
RaiseCanExecuteChanged();
}
}