Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

SelectionChangedCommandParameter is evaluated before SelectedItem updates in .NET 11

Abierto
#1,165 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
frontend

Línea de trabajo

Ejecute el ejemplo adjunto y reproduzca el comportamiento seleccionando un elemento en la CollectionView. Inspeccione el orden entre la actualización del enlace de SelectedItem y la ejecución de SelectionChangedCommand, y luego verifique que SelectionChangedCommandParameter recibe el elemento actualizado o la propiedad de ViewModel cuando se ejecuta el comando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug :bug: mvvm-toolkit :toolbox: needs author feedback :memo:
Describe the bug

When using CommunityToolkit-generated commands with CollectionView, the SelectionChangedCommandParameter is evaluated before the SelectedItem binding is updated in .NET 11.
This behavior differs from .NET 10, where the bound SelectedItem was already updated when the command executed.
As a result, commands that rely on ViewModel properties (for example, SelectedItem) receive null or stale values.

  • The command executes before the SelectedItem binding is updated.
  • SelectionChangedCommandParameter is null or contains the previous value.
  • This breaks scenarios that rely on ViewModel-bound properties inside the command.
Regression

8.0.3

Steps to reproduce

Run the attached sample.
Tap/select an item in the CollectionView.
Observe that SelectionChangedCommand is invoked.
Inspect the value of SelectionChangedCommandParameter.

Expected behavior

SelectionChangedCommandParameter should receive the updated selected item (or the updated ViewModel property) when the command executes.

Screenshots

No response

IDE and version

VS 2022

IDE version

No response

Nuget packages
  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)

8.0.4

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Lenguaje dominante
C#
Estrellas
3.8k
Forks
401
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CommunityToolkit/dotnet

Todos los issues de CommunityToolkit/dotnet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.