CommunityToolkit / CommunityToolkit/dotnet
Unseal RelayCommand and AsyncRelayCommand
- Vorherrschende Sprache
- C#
- Sterne
- 3.8k
- Forks
- 400
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### 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
Beitragsleitfaden
Rechercherichtung
Lokalisieren Sie die Definitionen von RelayCommand und AsyncRelayCommand und prüfen Sie die Tests oder API-Surface-Prüfungen in der Nähe, bevor Sie deren Deklarationen ändern. Bestätigen Sie, dass von beiden Typen wie im Issue gezeigt geerbt werden kann, und führen Sie die relevanten Projekttests oder den Build aus, um zu überprüfen, dass die öffentliche API weiterhin gültig ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100