Refreshing all properties of an ObservableObject
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp
- Área
- developer-experience
Línea de trabajo
Comienza con ObservableObject y su ruta OnPropertyChanged(null), y luego investiga cómo el extremo receptor gestiona un nombre de propiedad null en escenarios AOT. Compara el método propuesto de enumeración de propiedades con las notificaciones individuales automáticas y define qué comportamiento y API permitirían actualizar todas las propiedades observables sin reflexión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 3.8k
- Forks
- 401
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CommunityToolkit/dotnet
-
RelayCommand<T>.CanExecute(null) returns false for value types without a predicatePosiblemente ocupada @apachezy la tomó hace 85 días. Abiertobug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
CommunityToolkit/dotnet#1206 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
CommunityToolkit/dotnet#1186 ·
-
bug :bug:
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
CommunityToolkit/dotnet#648 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
CommunityToolkit/dotnet#1217 ·
-
bug :bug:
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
CommunityToolkit/dotnet#1215 ·
Todos los issues de CommunityToolkit/dotnet
Issues similares
-
Backend enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)Abiertoarea: sim area: unity enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
eyalgolan/statecraft-israel#1107 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
dimitar-radenkov/Pointframe#271 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
qew21/Genshin-Subtitles#45 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
HoffmanEngineering/3d-print-log-api#274 ·
Los mantenedores suelen responder en 1 día