Skip to content

Commit 7a166f3

Browse files
committed
fix: Expander header icon flip when collapsing or expanding canceled
1 parent 3725f0d commit 7a166f3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Avalonia.Themes.Fluent/Controls/Expander.xaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
</ControlTemplate>
116116
</Setter>
117117

118-
<Style Selector="^:checked /template/ Path#ExpandCollapseChevron">
118+
<Style Selector="^[Tag=expanded] /template/ Path#ExpandCollapseChevron">
119119
<Style.Animations>
120120
<Animation FillMode="Both" Duration="0:0:0.0625">
121121
<KeyFrame Cue="100%">
@@ -125,7 +125,7 @@
125125
</Style.Animations>
126126
</Style>
127127

128-
<Style Selector="^:not(:checked) /template/ Path#ExpandCollapseChevron">
128+
<Style Selector="^[Tag=collapsed] /template/ Path#ExpandCollapseChevron">
129129
<Style.Animations>
130130
<Animation FillMode="Both" Duration="0:0:0.0625">
131131
<KeyFrame Cue="0%">
@@ -262,8 +262,13 @@
262262
<Setter Property="VerticalAlignment" Value="Stretch" />
263263
</Style>
264264

265+
<Style Selector="^:expanded /template/ ToggleButton#ExpanderHeader">
266+
<Setter Property="Tag" Value="expanded" />
267+
</Style>
268+
265269
<Style Selector="^:not(:expanded) /template/ ToggleButton#ExpanderHeader">
266270
<Setter Property="CornerRadius" Value="{Binding $parent[Expander].CornerRadius}" />
271+
<Setter Property="Tag" Value="collapsed" />
267272
</Style>
268273
<Style Selector="^:expanded:up /template/ ToggleButton#ExpanderHeader">
269274
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />

0 commit comments

Comments
 (0)