Skip to content
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

AsyncCommand must be cast to IAsyncCommand or ICommand to access CanExecute and CanExecuteChanged #14

Closed
cmeeren opened this issue Nov 10, 2016 · 1 comment
Assignees

Comments

@cmeeren
Copy link

cmeeren commented Nov 10, 2016

While unit testing a command defined as AsyncCommand instead of IAsyncCommand (as you mentioned in #11), I discovered that I could not access MyAsyncCommand.CanExecute or .CanExecuteChanged; I had to cast it everywhere I wanted to access these properties:

((IAsyncCommand) MyAsyncCommand).CanExecute.

Just checking to see if this is a deliberate choice on your part, and if so, what the reasons are.

@StephenCleary StephenCleary self-assigned this Nov 15, 2016
@StephenCleary
Copy link
Owner

This is deliberate. The CanExecute and CanExecuteChanged members are intended for use by UI bindings, and not code directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants