Refreshing all properties of an ObservableObject
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- developer-experience
Direzione di ricerca
Inizia con ObservableObject e il relativo percorso OnPropertyChanged(null), quindi analizza come il lato ricevente gestisce un nome di proprietà null negli scenari AOT. Confronta il metodo proposto di enumerazione delle proprietà con le notifiche individuali automatiche e definisci quale comportamento e quale API consentirebbero di aggiornare tutte le proprietà osservabili senza reflection.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This issue falls in between a feature request and a bug.
Given a case scenario you want to refresh all the properties of an ObservableObject, the recommended pattern is this:
public void RefreshAllProperties() => OnPropertyChanged(null);
Raising a property changed as null is usually the suggested approach to signal that all properties are changed.
The problem with this pattern is that it assumes the receiving end is able to list (via reflection) all the properties that are bound for refreshment.
But when you're in an AOT scenario, I am wondering if, in this crippled scenario where reflection is not possible, how to resolve this.
I think the solution for this would be, if AOT is detected, instead of raising a single null property change, to raise a sequence of indivisual property changes, one for every observable property.
And, I think this can be done in two ways:
1- to have a protected method that enumerates all the observable properties (something that could be usefull for other scenarios, like populating PropertyGrid controls) , and the let the developer implement its own RefreshAllProperties();
2- to make OnPropertyChanged(); smarter, by detecting when a null argument is passed, and if it detectes its in AOT, instead of relaying the null, to swich to raise a propertychange sequence.
Btw, I'm relatively new to CommunityToolkit.mvvm , so I wrote this issue under the assumption there's no way to do this other to manually raise all the property changes.
- Lingua principale
- C#
- Stelle
- 3.8k
- Fork
- 401
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CommunityToolkit/dotnet
-
RelayCommand<T>.CanExecute(null) returns false for value types without a predicateForse già presa @apachezy l’ha presa 86 giorni fa. Apertabug :bug:
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
CommunityToolkit/dotnet#1206 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
CommunityToolkit/dotnet#1186 ·
-
bug :bug:
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
CommunityToolkit/dotnet#648 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
CommunityToolkit/dotnet#1217 ·
-
bug :bug:
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
CommunityToolkit/dotnet#1215 ·
Tutte le issue di CommunityToolkit/dotnet
Issue simili
-
Format request: .wbpzApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
KnifeLemon/Filee#294 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
gavin-wolfe/wolfden#104 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt fileApertatype/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
area:framework
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
nunit/docs#1262 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[辞書] かんそうりつ->乾燥率Aperta辞書
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno