CommunityToolkit / CommunityToolkit/dotnet

Unseal RelayCommand and AsyncRelayCommand

Open
#802 3 comments 0 reactions 0 assignees View on GitHub
feature request :mailbox_with_mail:
Dominant language
C#
Stars
3.8k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

### Overview

I'm working on custom command that will let the developer pass a permission string into the constructor and if the user has that permission then command will be enabled if CanExecute returns true and will be disabled when CanExecute returns false or the user doesn't have that permission. I wanted to inherit from RelayCommand and AsyncRelayCommand but am not able to due to them being marked as sealed.

### API breakdown

Remove sealed keyword from RelayCommand and AsyncRelayCommand.

### Usage example

```
public class CustomCommand : RelayCommand {
...
}
```

```
public class AsyncCustomCommand : AsyncRelayCommand {
...
}
```

### Breaking change?

No

### Alternatives

Re-implement RelayCommand and AsyncRelayCommand functionality for custom commands.

### Additional context

_No response_

### Help us help you

No, just wanted to propose this

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.