I've experienced some weird behaviour when changing the width, the tick scale and the value of the slider simultaneously. The position of the thumb becomes erratic. The behaviour is very hard to describe in words. Try the code below and see for yourself. The weirdness appears when the first button is clicked.
<UserControl x:Class="SilverlightApplication7.Page6" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
Width="600" Height="300"> |
<Grid x:Name="LayoutRoot" Background="White"> |
<StackPanel> |
<telerik:RadSlider x:Name="Sld01" |
HorizontalAlignment="Stretch" |
Minimum="1" |
Maximum="10" |
Value="3" |
TickFrequency="1" |
IsMoveToPointEnabled="True" |
IsSnapToTickEnabled="True" |
TickPlacement="Both"></telerik:RadSlider> |
<Button x:Name="Btn01" Content="5 steps, value 3, width 250"></Button> |
<Button x:Name="Btn02" Content="10 steps value 3, width 500"></Button> |
</StackPanel> |
</Grid> |
</UserControl> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Net; |
using System.Windows; |
using System.Windows.Controls; |
using System.Windows.Documents; |
using System.Windows.Input; |
using System.Windows.Media; |
using System.Windows.Media.Animation; |
using System.Windows.Shapes; |
namespace SilverlightApplication7 |
{ |
public partial class Page6 : UserControl |
{ |
public Page6() |
{ |
InitializeComponent(); |
Btn01.Click += new RoutedEventHandler(Btn01_Click); |
Btn02.Click += new RoutedEventHandler(Btn02_Click); |
} |
void Btn01_Click(object sender, RoutedEventArgs e) |
{ |
Sld01.Minimum = 1; |
Sld01.Maximum = 5; |
Sld01.Value = 3; |
Sld01.Margin = new Thickness(0, 0, 350, 0); |
} |
void Btn02_Click(object sender, RoutedEventArgs e) |
{ |
Sld01.Minimum = 1; |
Sld01.Maximum = 10; |
Sld01.Value = 3; |
Sld01.Margin = new Thickness(0, 0, 100, 0); |
} |
} |
} |