WPF-Prism CanExecute method not being called

前端 未结 4 1337
南方客
南方客 2021-02-01 19:06

I am coding a simple login UserControl with two TextBoxes (Username and Password) and a Login button. I want the Login button to be enabled only when the username and password f

4条回答
  •  醉话见心
    2021-02-01 19:46

    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 the CanExecute state.

提交回复
热议问题