MaterialDesignChoiceChipListBoxItem missing 'Path=Name' in GroupName binding causes selection conflict between ListBoxes

オープン 初心者向け
#4,118 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
desktop

調査の方向性

不具合は src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml の 811 行目付近にあります。そこでは MaterialDesignChoiceChipListBoxItem スタイルが、Path=Name を指定せずに RadioButton.GroupName を親の ListBox にバインドしています。839 行目と 866 行目付近にある、Primary と Secondary のチップの兄弟スタイルと比較してください。それらは ListBox の Name にバインドしています。デフォルトスタイルが兄弟スタイルと同じ方法でバインドし、同じ項目数の 2 つの ListBox が互いの選択を解除しなくなれば完了です。choice chip を対象とする WPF のテストやサンプルプロジェクトがあるか確認してください。また、issue #3473 は以前、修正されないままクローズされていたことに注意してください。

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

説明

bug evaluation required
Bug explanation

style MaterialDesignChoiceChipListBoxItem binds RadioButton.GroupName to parent ListBox itself without specifying Path=Name.
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/087728011a8d71926ccf86cb28dc99439e9b1c3f/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml#L811

this causes RadioButton.GroupName to be something like System.Windows.Controls.ListBox Items.Count:4.
if 2 listboxes have same number of items, one listbox's selection 'clears' another listbox's selection.

other variations, such as MaterialDesignChoiceChipPrimaryListBoxItem, MaterialDesignChoiceChipSecondaryListBoxItem etc, bind RadioButton.GroupName to parent ListBox's Name property. so those styles do not have the problem as long
as parent ListBox has Name property specified.
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/087728011a8d71926ccf86cb28dc99439e9b1c3f/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml#L839
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/087728011a8d71926ccf86cb28dc99439e9b1c3f/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml#L866

this same issue was once opened as #3473 before, but the OP closed it thinking it was solved in 5.0.0.
but as of 5.4.0, the problem remains in the master branch.

thank you.

Version

5.4.0

主要言語
C#
スター
16.3k
フォーク
3.5k
平均マージ
2日 7時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

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

MaterialDesignInXAML/MaterialDesignInXamlToolkit のほかの issue

MaterialDesignInXAML/MaterialDesignInXamlToolkit の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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