Loading...
Loading...
Compare original and translation side by side
<!-- Add namespace -->
<Window xmlns:slider="using:Syncfusion.UI.Xaml.Sliders">
<Grid>
<slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Width="400"
Margin="20" />
</Grid>
</Window><!-- Add namespace -->
<Window xmlns:slider="using:Syncfusion.UI.Xaml.Sliders">
<Grid>
<slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Width="400"
Margin="20" />
</Grid>
</Window><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
Width="400" /><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
Width="400" /><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
ShowDividers="True"
ShowToolTip="True"
MinorTicksPerInterval ="1"
Width="400"
Height="60" /><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
ShowDividers="True"
ShowToolTip="True"
MinorTicksPerInterval ="1"
Width="400"
Height="60" />using Syncfusion.UI.Xaml.Sliders;
// Create slider
SfSlider slider = new SfSlider();
slider.Value = 50;
slider.Minimum = 0;
slider.Maximum = 100;
slider.Interval = 10;
slider.ShowLabels = true;
slider.ShowTicks = true;
slider.Width = 400;
// Handle value changes
slider.ValueChanged += (sender, e) =>
{
double newValue = e.NewValue;
Console.WriteLine($"Value changed to: {newValue}");
};
// Add to layout
rootGrid.Children.Add(slider);using Syncfusion.UI.Xaml.Sliders;
// Create slider
SfSlider slider = new SfSlider();
slider.Value = 50;
slider.Minimum = 0;
slider.Maximum = 100;
slider.Interval = 10;
slider.ShowLabels = true;
slider.ShowTicks = true;
slider.Width = 400;
// Handle value changes
slider.ValueChanged += (sender, e) =>
{
double newValue = e.NewValue;
Console.WriteLine($"Value changed to: {newValue}");
};
// Add to layout
rootGrid.Children.Add(slider);<slider:SfSlider Value="{Binding Volume, Mode=TwoWay}"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
ShowToolTip="True"
Width="300">
</slider:SfSlider><slider:SfSlider Value="{Binding Volume, Mode=TwoWay}"
Minimum="0"
Maximum="100"
Interval="10"
ShowLabels="True"
ShowTicks="True"
ShowToolTip="True"
Width="300">
</slider:SfSlider><slider:SfSlider Value="{Binding MaxPrice, Mode=TwoWay}"
Minimum="0"
Maximum="1000"
Interval="100"
ShowLabels="True"
ShowTicks="True"
Width="400">
</slider:SfSlider><slider:SfSlider Value="{Binding MaxPrice, Mode=TwoWay}"
Minimum="0"
Maximum="1000"
Interval="100"
ShowLabels="True"
ShowTicks="True"
Width="400">
</slider:SfSlider><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Orientation="Vertical"
ShowLabels="True"
ShowTicks="True"
Height="300"
Width="80" /><slider:SfSlider Value="50"
Minimum="0"
Maximum="100"
Orientation="Vertical"
ShowLabels="True"
ShowTicks="True"
Height="300"
Width="80" /><slider:SfSlider Value="50"
IsEnabled="False"
ShowLabels="True"
ShowTicks="True"
Width="400" /><slider:SfSlider Value="50"
IsEnabled="False"
ShowLabels="True"
ShowTicks="True"
Width="400" />| Property | Type | Description |
|---|---|---|
| | Current value of the slider |
| | Minimum value (default: 0) |
| | Maximum value (default: 100) |
| | Spacing between labels and ticks (default: calculated) |
| | Display value labels (default: false) |
| | Display tick marks (default: false) |
| | Display dividers between intervals (default: false) |
| | Display tooltip on thumb hover/drag (default: false) |
| | Horizontal or Vertical (default: Horizontal) |
| | Reverse the direction (default: false) |
| | Number of minor ticks per interval (default: 0) |
| | Height of the filled track |
| | Height of the unfilled track |
| | Height of divider markers |
| | Width of divider markers |
| 属性 | 类型 | 描述 |
|---|---|---|
| | 滑块的当前值 |
| | 最小值(默认:0) |
| | 最大值(默认:100) |
| | 标签和刻度之间的间距(默认:自动计算) |
| | 是否展示值标签(默认:false) |
| | 是否展示刻度(默认:false) |
| | 是否展示间隔之间的分隔线(默认:false) |
| | 滑块按钮hover/拖动时是否展示提示框(默认:false) |
| | 水平或垂直布局(默认:水平) |
| | 是否反转方向(默认:false) |
| | 每个间隔内的次刻度数量(默认:0) |
| | 已填充轨道的高度 |
| | 未填充轨道的高度 |
| | 分隔线标记的高度 |
| | 分隔线标记的宽度 |
| Event | Description |
|---|---|
| Fired when the slider value changes |
| 事件 | 描述 |
|---|---|
| 滑块值发生变化时触发 |
xmlns:slider="using:Syncfusion.UI.Xaml.Sliders"xmlns:slider="using:Syncfusion.UI.Xaml.Sliders"