でグループ化の外観をカスタマイズしていListBox
ます。でListBox.Resources
、私は次のようなものを宣言しました(フォーマットは削除されました):
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<StackPanel Orientation="Vertical">
<!-- Group label -->
<ContentPresenter />
<!-- Items in group -->
<ItemsPresenter />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
実際のグループラベルはあまり読みにくいので、値変換器を使用して見やすくしたいと思います。ただし、このテキストを取得して変換する方法が見つかりません。
Binding
コンバーターを使用させてくれると思います。
上記を次のようなものに置き換えてみましたContentPresenter
...
<TextBlock Text="{TemplateBinding Content}"/>
<TextBlock Text="{Binding}"/>
...そして他の多くのものが、役に立たない。助言がありますか?