CommunityToolkit / CommunityToolkit/dotnet
Unseal RelayCommand and AsyncRelayCommand
- Lingua principale
- C#
- Stelle
- 3.8k
- Fork
- 400
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Locate the RelayCommand and AsyncRelayCommand definitions and inspect nearby tests or API-surface checks before changing their declarations. Confirm that both types can be inherited from as shown in the issue, and run the relevant project tests or build to verify the public API remains valid.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100