fix: simplify Expander icon.

This commit is contained in:
rabbitism 2022-12-16 19:22:02 +08:00
parent 507f030520
commit b32aee2e40

View File

@ -44,9 +44,17 @@
Grid.Column="0" Grid.Column="0"
Content="{TemplateBinding Header}" Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" /> ContentTemplate="{TemplateBinding HeaderTemplate}" />
<ContentPresenter <PathIcon
Name="PART_IconContentPresenter" Grid.Column="1" Name="PART_PathIcon" Grid.Column="1"
Margin="{DynamicResource ExpanderEndIconMargin}" /> Width="{DynamicResource ExpanderIconSize}"
Height="{DynamicResource ExpanderIconSize}"
Data="M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z">
<PathIcon.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
</Transitions>
</PathIcon.Transitions>
</PathIcon>
</Grid> </Grid>
</ToggleButton> </ToggleButton>
</LayoutTransformControl> </LayoutTransformControl>
@ -71,32 +79,8 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^:expanded /template/ ContentPresenter#PART_IconContentPresenter"> <Style Selector="^:expanded /template/ PathIcon#PART_PathIcon">
<Setter Property="ContentPresenter.Content"> <Setter Property="PathIcon.RenderTransform" Value="rotate(180deg)" />
<Template>
<PathIcon
Width="{DynamicResource ExpanderIconSize}"
Height="{DynamicResource ExpanderIconSize}"
Data="M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z" />
</Template>
</Setter>
</Style>
<Style Selector="^:not(:expanded) /template/ ContentPresenter#PART_IconContentPresenter">
<Setter Property="ContentPresenter.Content">
<Template>
<PathIcon
Width="{DynamicResource ExpanderIconSize}"
Height="{DynamicResource ExpanderIconSize}"
Data="M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z">
<PathIcon.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180" CenterX="0.6" CenterY="0.6" />
</TransformGroup>
</PathIcon.RenderTransform>
</PathIcon>
</Template>
</Setter>
</Style> </Style>
<Style Selector="^:right"> <Style Selector="^:right">