You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that I frequently have long lists of commands to update when properties change. It might be nice to be able to flag a class to raise CanExecuteChanged events for all commands whenever any property changes, then you wouldn't have to worry about remembering each command for each dependent property.
I think it would cut down on a decent amount of boilerplate with a fairly minor performance hit from unnecessarily calling CanExecute.
API breakdown
I think the API would just be an attribute you can add to an ObservableObject like this:
Since this is an opt-in feature, there shouldn't be breaking changes and it makes it clear at the top of the class what is happening behind the scenes.
Help us help you
No, just wanted to propose this
The text was updated successfully, but these errors were encountered:
Overview
I've found that I frequently have long lists of commands to update when properties change. It might be nice to be able to flag a class to raise CanExecuteChanged events for all commands whenever any property changes, then you wouldn't have to worry about remembering each command for each dependent property.
I think it would cut down on a decent amount of boilerplate with a fairly minor performance hit from unnecessarily calling CanExecute.
API breakdown
I think the API would just be an attribute you can add to an ObservableObject like this:
Usage example
would generate the following code:
Breaking change?
No
Alternatives
Edit:
You could also require/allow the attribute to take in the command names that you want to always update, ie:
or maybe place the attribute on each command or tie it in to the
RelayCommandAttribute
:Additional context
Since this is an opt-in feature, there shouldn't be breaking changes and it makes it clear at the top of the class what is happening behind the scenes.
Help us help you
No, just wanted to propose this
The text was updated successfully, but these errors were encountered: