What I want to achieve: To collapse or expand all Expanders that share the same group name within a group style.
We have a ListBox and another ListBox nested inside it to display child items. The child items ItemsSource is bound to a CollectionView with Group descriptions attached.
The group item template is quite simple:
<Expander IsExpanded="{Binding Path=WHAT_TO_DO, Mode=TwoWay}">
<Expander.Header>
<TextBlock Text="{Binding Name}" />
</Expander.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" SharedSizeGroup="{Binding Name, Converter={StaticResource GroupNameToUniqueNameConverter}}" />
</Grid.RowDefinitions>
<ItemsPresenter/>
</Grid>
</Expander>