Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

SelectionChangedCommandParameter is evaluated before SelectedItem updates in .NET 11

Aperta
#1,165 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
frontend

Direzione di ricerca

Eseguire l’esempio allegato e riprodurre il comportamento selezionando un elemento nella CollectionView. Esaminare l’ordine tra l’aggiornamento del binding di SelectedItem e l’esecuzione di SelectionChangedCommand, quindi verificare che SelectionChangedCommandParameter riceva l’elemento aggiornato o la proprietà di ViewModel quando viene eseguito il comando.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
3.8k
Fork
401
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CommunityToolkit/dotnet

Tutte le issue di CommunityToolkit/dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.