Version: Q1 2012 .NET4
Having updated from the Q3 2010, we noticed a problem in the resize behavior of the RadTickBar, when the RadSlider is provided with a TickDataTemplate which renders textual information for each tick. While resizing the slider to a smaller size, there seems to be a point of the process after which the RadTickBar cannot keep up. From that point on, the outer ticks of the slider start to get clipped out, even though the distance between the ticks appears to be enough to fit them all. On top of that, the position of each tick at that point
miss-matches the corresponding position of the thumb of the slider (thus proving that the slider it self has resized successfully, while the tick-bar has not).
We have tried to set a MinWidth for the RadTickBar through the TickBarStyle property, however that causes an InvalidOperationException. Perhaps that is something you could check as well.
The following is the sample code which reproduces this behavior. To do so, just execute it and try to gradually resize the window to a smaller size. Plus, as far as the second issue (regarding the RadTickBar MinWidth) is concerned, try uncommenting the corresponding XAML code, and executing the project.
Yours faithfully,
Nikos Nakas
Entersoft SA Development Department
Window XAML markup:
Value Converter:
Having updated from the Q3 2010, we noticed a problem in the resize behavior of the RadTickBar, when the RadSlider is provided with a TickDataTemplate which renders textual information for each tick. While resizing the slider to a smaller size, there seems to be a point of the process after which the RadTickBar cannot keep up. From that point on, the outer ticks of the slider start to get clipped out, even though the distance between the ticks appears to be enough to fit them all. On top of that, the position of each tick at that point
miss-matches the corresponding position of the thumb of the slider (thus proving that the slider it self has resized successfully, while the tick-bar has not).
We have tried to set a MinWidth for the RadTickBar through the TickBarStyle property, however that causes an InvalidOperationException. Perhaps that is something you could check as well.
The following is the sample code which reproduces this behavior. To do so, just execute it and try to gradually resize the window to a smaller size. Plus, as far as the second issue (regarding the RadTickBar MinWidth) is concerned, try uncommenting the corresponding XAML code, and executing the project.
Yours faithfully,
Nikos Nakas
Entersoft SA Development Department
Window XAML markup:
<
Window
x:Class
=
"MainWindow"
xmlns:local
=
"clr-namespace:WpfRadSliderTest"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Window.Resources
>
<
local:IntegerToMonthConverter
x:Key
=
"intToMonthConv"
/>
</
Window.Resources
>
<
Grid
>
<
telerik:RadSlider
Margin
=
"25"
VerticalAlignment
=
"Center"
telerik:StyleManager.Theme
=
"Windows7"
Minimum
=
"0"
Maximum
=
"5"
TickFrequency
=
"1"
IsMouseWheelEnabled
=
"True"
IsSnapToTickEnabled
=
"True"
IsMoveToPointEnabled
=
"True"
TickPlacement
=
"BottomRight"
>
<
telerik:RadSlider.TickTemplate
>
<
DataTemplate
>
<
Grid
Background
=
"Purple"
MinHeight
=
"{Binding Path=ActualHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=telerik:RadTickBar}}"
>
<
StackPanel
>
<
Ellipse
Width
=
"5"
Height
=
"5"
Fill
=
"Black"
/>
<
Label
Content
=
"{Binding Mode=OneWay, Converter={StaticResource intToMonthConv}}"
Foreground
=
"Yellow"
/>
</
StackPanel
>
</
Grid
>
</
DataTemplate
>
</
telerik:RadSlider.TickTemplate
>
<!--<
telerik:RadSlider.TickBarStyle
>
<
Style
TargetType
=
"telerik:RadTickBar"
>
<
Setter
Property
=
"MinWidth"
Value
=
"50"
/>
</
Style
>
</
telerik:RadSlider.TickBarStyle
>-->
</
telerik:RadSlider
>
</
Grid
>
</
Window
>
Value Converter:
Public
Class
IntegerToMonthConverter
Implements
IValueConverter
Private
Shared
ReadOnly
Months
As
String
() = {
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
}
Public
Function
Convert(value
As
Object
, targetType
As
System.Type, parameter
As
Object
, culture
As
System.Globalization.CultureInfo)
As
Object
Implements
System.Windows.Data.IValueConverter.Convert
Dim
index =
CInt
(value)
If
index < 0
OrElse
index >= Months.Length
Then
Return
String
.Empty
Return
Months(index)
End
Function
Public
Function
ConvertBack(value
As
Object
, targetType
As
System.Type, parameter
As
Object
, culture
As
System.Globalization.CultureInfo)
As
Object
Implements
System.Windows.Data.IValueConverter.ConvertBack
Throw
New
NotSupportedException
End
Function
End
Class