-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommandParameter evaluates CanExecute #3452
Comments
Please note that this issue exists also with the MenuItem class. I haven't checked, but this probably also applies to the InputBinding class, and possibly any other class that has a pair of Command and CommandParameter dependency properties (e.g. ThumbButtonInfo, Hyperlink, etc.) I'm not entirely clear on the relationship between CommandManager and various WPF types that implement this property pair, but it seems like this issue and https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/3571 are related to each other, if not actually duplicates. The main complaint on that issue is that the CommandManager doesn't respond to changes to bound CommandParameter values and call CanExecute() in response. My expectation is that in both scenarios, when the source of a bound CommandParameter value changes, the associated ICommand.CanExecute() method will be called with the new parameter value, and (where applicable) the state of the element owning the bound property will be updated accordingly (i.e. disabled if CanExecute() returns false, enabled if it returns true). |
I hate this issue so much. It has been broken forever |
Closing as the completed since the corresponding PR has been merged and released. |
This issue has been moved from a ticket on Developer Community.
Behavior concerning ButtonBase-Class:
Currently, only the ValueChangedCallback from the CommandProperty invokes the CanExecute-Method of the given Command. It would be highly useful, if also the ValueChangedCallback of the CommandParameterProperty would invoke CanExecute on the Command (if not null).
Original Comments
Fiona Niu[MSFT] on 10/19/2018, 05:51 PM:
Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. You will hear from us in about a week on our next steps.
The text was updated successfully, but these errors were encountered: