Skip to content

Attribute for Updating Commands on Property Changes #22

@VPDPersonal

Description

@VPDPersonal

An attribute to automatically trigger NotifyCanExecuteChanged for commands when dependent properties change, reducing manual boilerplate code.

[ViewModel]
public partial class MyViewModel
{
    [Bind]
    [NotifyCanExecuteChanged(nameof(ClickCommand))]
    private bool _isInteractable;

    [RelayCommand(CanExecute = nameof(IsInteractable))]
    private void Click()
    {
        // ...
    }
}

Metadata

Metadata

Assignees

Labels

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions