This is MVVM application. There is a window and related view model class.
There is TextBox
, Button
and ListBox
on form. Button is
Try raising CanExecuteChanged
when your property changes. The command binding is really distinct from the property binding and buttons bound to commands are alerted to a change in status by the CanExecuteChanged
event.
In your case, you could fire a check when you do the PropertyChanged
on the bound property that would evaluate it and set the command's internal CanExecute
flag and then raise CanExecuteChanged
. More of a "push" into the ICommand
object than a "pull".