Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

SelectionChangedCommandParameter is evaluated before SelectedItem updates in .NET 11

オープン
#1,165 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
frontend

調査の方向性

添付されたサンプルを実行し、CollectionView で項目を選択して動作を再現します。SelectedItem バインディングの更新と SelectionChangedCommand の実行の順序を調べ、コマンドの実行時に SelectionChangedCommandParameter が更新された項目または ViewModel プロパティを受け取ることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C#
スター
3.8k
フォーク
401
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommunityToolkit/dotnet のほかの issue

CommunityToolkit/dotnet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。