저는 XAML과 WPF에 매우 익숙하지만 다음을 시도하고 있습니다.IsExpanded Binding
groupDescription을 기반으로 확장자로 ListView를 빌드합니다. 어느 것이 잘 작동합니다. 이제 응용 프로그램 내에서 탭을 전환하면 이전 사용자가 선택한 확장 및 축소 된 확장기를 선택했기 때문에 IsExpanded 속성을 항목에 바인딩하려고합니다. 즉, 모든 확장자가 기본값으로 되돌려 져서 축소 된 것을 의미합니다. 이는 매우 성가신 일입니다.
그러나 실제로 어떻게 작동하는지 이해하지 못합니다. 확장기의 IsExpanded 속성을 해당 클래스의 속성에 바인딩 할 수 있습니까? 어떻게 다른 그룹을 구별 할 수 있습니까?
는<ListView Name="Mails" local:FM.Register="{Binding}" local:FM.GetFocus="Loaded"
Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
ItemsSource="{Binding Path=MailsProxy.View}"
SelectionMode="Single" SelectedItem="{Binding Path=SelectedMail, Mode=TwoWay}"
local:SortList.BringIntoViewSelected="True" local:SortList.IsGridSortable="True"
ItemContainerStyle="{StaticResource InboxMailItem}"
View="{Binding Source={x:Static session:Session.Current}, Path=InboxView.View}">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Margin" Value="0,0,0,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander Foreground="Black" BorderThickness="0,0,0,1" Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<DockPanel>
<TextBlock FontWeight="Bold" FontSize="14" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=ListView}, Path=DataContext.GroupBy}"/>
<TextBlock FontWeight="Bold" FontSize="14">:</TextBlock>
<TextBlock FontSize="14" Text="{Binding Path=Name, Converter={StaticResource GroupHeaderConverter}}" Margin="5,0,0,0"/>
</DockPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
<ListView.Resources>
<Style TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="DataContext" Value="{Binding Source={x:Static session:Session.Current}, Path=InboxView}"/>
</Style>
</ListView.Resources>
</ListView>
답장을 보내 주셔서 감사합니다. 조금 자세히 설명해 주시겠습니까? – Xeun