With CanExecuteDependsOnAttribute we don't need to locate and decorate ObservableProperty whenever commands depend on it. It is more convenient if we place all setup related to a command in one place rather than two places spanned across multiple lines.
In my opinion
ObservableProperty
(as a publisher) should not know anything aboutICommand
(as a subscriber). So the followingis more elegant if it can be written as follows.
With
CanExecuteDependsOnAttribute
we don't need to locate and decorateObservableProperty
whenever commands depend on it. It is more convenient if we place all setup related to a command in one place rather than two places spanned across multiple lines.Any comments are welcome.