Skip to content

Commit 64f61e3

Browse files
zrt2399MrJul
authored andcommitted
fix: reverse TickBar when Slider direction is reversed (#19096)
1 parent 4938899 commit 64f61e3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

samples/ControlCatalog/Pages/SliderPage.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
IsSnapToTickEnabled="True"
2222
Ticks="0,20,25,40,75,100"
2323
Width="300" />
24+
<Slider Name="ReversedTickedSlider"
25+
Value="0"
26+
Minimum="0"
27+
Maximum="100"
28+
TickPlacement="BottomRight"
29+
IsSnapToTickEnabled="True"
30+
IsDirectionReversed="True"
31+
Ticks="0,20,25,40,75,100"
32+
Width="300" />
2433
<Slider Name="SliderWithTooltip"
2534
Value="0"
2635
Minimum="0"

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
VerticalAlignment="Bottom"
130130
Placement="Top"
131131
IsVisible="False"
132+
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
132133
Fill="{DynamicResource SliderTickBarFill}"/>
133134
<TickBar
134135
Name="BottomTickBar"
@@ -144,6 +145,7 @@
144145
VerticalAlignment="Top"
145146
Placement="Bottom"
146147
IsVisible="False"
148+
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
147149
Fill="{DynamicResource SliderTickBarFill}" />
148150
<Track
149151
Name="PART_Track"
@@ -225,8 +227,9 @@
225227
HorizontalAlignment="Right"
226228
Placement="Left"
227229
IsVisible="False"
230+
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
228231
Fill="{DynamicResource SliderTickBarFill}"/>
229-
<TickBar
232+
<TickBar
230233
Name="RightTickBar"
231234
Grid.RowSpan="3"
232235
Grid.Column="2"
@@ -240,6 +243,7 @@
240243
HorizontalAlignment="Left"
241244
Placement="Right"
242245
IsVisible="False"
246+
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
243247
Fill="{DynamicResource SliderTickBarFill}"/>
244248
<Track
245249
Name="PART_Track"

0 commit comments

Comments
 (0)