CanExecute Logic for DelegateCommand

前端 未结 3 1313
名媛妹妹
名媛妹妹 2020-12-14 21:22

Update: The focus became MVVM instead of the actual question so I\'m updating it.

I\'m having a problem with CanExecute for Deleg

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 22:00

    There is a bug in the DelegateCommand provided by Prism which doesn't raise the CanExecute event. I beat my head against the wall for a day until I dove into the DelegateCommand class provided by the Prism framework. I don't have the code with me, but I can post my resolution in a bit.

    The alternative is to use one of the other RelayCommand frameworks out there.

    Edit
    Rather than reposting the code, there are other SO questions that provide resolutions:

    • WPF-Prism CanExecute method not being called

    And Kent B. has a good article: MVVM Infrastructure: DelegateCommand

提交回复
热议问题