Wrong NotifyCanExecuteChangedFor in example

Open Beginner friendly
#133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
65/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
documentation

Research direction

Open docs/mvvm/generators/RelayCommand.md and locate the “Enabling and disabling commands” section's second example. Compare the NotifyCanExecuteChangedFor attribute with the command shown in the example, update the incorrect reference, and verify the rendered documentation shows the corrected example.

Written by the indexing model from the issue text.

Description

dotnet dotnet-communitytoolkit/prod Pri1

In section 'Enabling and disabling commands', under second example, we have:
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(SelectedUser))] // <== this is wrong
private User? selectedUser;

but it should be:
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(GreetUser))] // <== this is right
private User? selectedUser;


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Dominant language
No language data
Stars
168
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MicrosoftDocs/CommunityToolkit

All issues in MicrosoftDocs/CommunityToolkit

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.