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

Add missing call to ICommand.CanExecute() in HyperlinkExtensions #3172

Merged

Conversation

vgromfeld
Copy link
Contributor

Fixes #3171

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Using HyperlinkExtensions.Command attached property, we can attach an ICommand to an Hyperlink. When the hyperlink is clicked, the command is executed without verifying if it can be executed.

What is the new behavior?

We will now call ICommand.CanExecute() before executing the command.

I've also made some minor changes.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

@ghost
Copy link

ghost commented Mar 18, 2020

Thanks vgromfeld for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost assigned michael-hawker Mar 18, 2020
@michael-hawker michael-hawker added this to the 6.1 milestone Mar 18, 2020
@vgromfeld vgromfeld merged commit abf77ed into CommunityToolkit:master Mar 19, 2020
@vgromfeld vgromfeld deleted the u/vgromfeld/hyperlinkCommand branch March 19, 2020 08:16
@michael-hawker michael-hawker added the bug 🐛 An unexpected issue that highlights incorrect behavior label Mar 20, 2020
@michael-hawker michael-hawker mentioned this pull request Apr 1, 2020
36 tasks
@Kyaa-dost Kyaa-dost added bug 🐛 An unexpected issue that highlights incorrect behavior and removed bug 🐛 An unexpected issue that highlights incorrect behavior labels Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hyperlink command extension is always executing the attached command
4 participants