csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
3.0 KiB
83 lines
3.0 KiB
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sys="using:System"
|
|
x:Class="ControlCatalog.Pages.SliderPage">
|
|
<StackPanel Orientation="Vertical" Spacing="4">
|
|
<TextBlock Classes="h2">A control that lets the user select from a range of values by moving a Thumb control along a Track.</TextBlock>
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 16 0 0" Spacing="16">
|
|
<StackPanel Orientation="Vertical"
|
|
HorizontalAlignment="Center">
|
|
<Slider Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
TickFrequency="10"
|
|
Width="300" />
|
|
<Slider Name="CustomTickedSlider"
|
|
Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
TickPlacement="BottomRight"
|
|
IsSnapToTickEnabled="True"
|
|
Ticks="0,20,25,40,75,100"
|
|
Width="300" />
|
|
<Slider Name="ReversedTickedSlider"
|
|
Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
TickPlacement="BottomRight"
|
|
IsSnapToTickEnabled="True"
|
|
IsDirectionReversed="True"
|
|
Ticks="0,20,25,40,75,100"
|
|
Width="300" />
|
|
<Slider Name="SliderWithTooltip"
|
|
Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
Width="300">
|
|
<Slider.Styles>
|
|
<Style Selector="Slider /template/ Thumb">
|
|
<Setter Property="ToolTip.Tip" Value="{Binding $parent[Slider].Value, Mode=OneWay, StringFormat='Value \{0:f\}'}" />
|
|
<Setter Property="ToolTip.Placement" Value="Top" />
|
|
<Setter Property="ToolTip.VerticalOffset" Value="-10" />
|
|
<Setter Property="ToolTip.HorizontalOffset" Value="-30" />
|
|
</Style>
|
|
</Slider.Styles>
|
|
</Slider>
|
|
<Slider Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
TickFrequency="10"
|
|
Width="300">
|
|
<DataValidationErrors.Error>
|
|
<sys:Exception />
|
|
</DataValidationErrors.Error>
|
|
</Slider>
|
|
<Slider Value="0"
|
|
IsDirectionReversed="True"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
TickFrequency="10"
|
|
Width="300" />
|
|
</StackPanel>
|
|
<Slider Value="0"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
Orientation="Vertical"
|
|
IsSnapToTickEnabled="True"
|
|
TickPlacement="Outside"
|
|
TickFrequency="10"
|
|
Height="300"/>
|
|
<Slider Value="0"
|
|
IsDirectionReversed="True"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
Orientation="Vertical"
|
|
IsSnapToTickEnabled="True"
|
|
TickPlacement="Outside"
|
|
TickFrequency="10"
|
|
Height="300"/>
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
</UserControl>
|
|
|