ClassScalePrimitive
Represents a component which visualize a line scale with ticks and labels.
Definition
Namespace:Telerik.UI.Xaml.Controls.Primitives
Assembly:Telerik.WinUI.Controls.dll
Syntax:
public class ScalePrimitive : RangeControlBase
Inheritance: objectRadControlRadHeaderedControlRangeControlBaseScalePrimitive
Inherited Members
Constructors
ScalePrimitive()
Initializes a new instance of the ScalePrimitive class.
Declaration
public ScalePrimitive()
Fields
LabelFormatProperty
Identifies the LabelFormat property.
Declaration
public static readonly DependencyProperty LabelFormatProperty
Field Value
DependencyProperty
LabelPlacementProperty
Identifies the LabelPlacement property.
Declaration
public static readonly DependencyProperty LabelPlacementProperty
Field Value
DependencyProperty
LabelStyleProperty
Identifies the LabelStyle property.
Declaration
public static readonly DependencyProperty LabelStyleProperty
Field Value
DependencyProperty
LabelTemplateProperty
Identifies the LabelTemplate property.
Declaration
public static readonly DependencyProperty LabelTemplateProperty
Field Value
DependencyProperty
LineStyleProperty
Identifies the LineStyle property.
Declaration
public static readonly DependencyProperty LineStyleProperty
Field Value
DependencyProperty
OrientationProperty
Identifies the Orientation property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
DependencyProperty
TickFrequencyProperty
Identifies the TickFrequency property.
Declaration
public static readonly DependencyProperty TickFrequencyProperty
Field Value
DependencyProperty
TickLengthProperty
Identifies the TickThickness property.
Declaration
public static readonly DependencyProperty TickLengthProperty
Field Value
DependencyProperty
TickPlacementProperty
Identifies the TickPlacement property.
Declaration
public static readonly DependencyProperty TickPlacementProperty
Field Value
DependencyProperty
TickStyleProperty
Identifies the TickStyle property.
Declaration
public static readonly DependencyProperty TickStyleProperty
Field Value
DependencyProperty
TickTemplateProperty
Identifies the TickTemplate property.
Declaration
public static readonly DependencyProperty TickTemplateProperty
Field Value
DependencyProperty
TickThicknessProperty
Identifies the TickThickness property.
Declaration
public static readonly DependencyProperty TickThicknessProperty
Field Value
DependencyProperty
Properties
LabelFormat
Gets or sets the string that is used to format the labels of the control.
Declaration
public string LabelFormat { get; set; }
Property Value
Remarks
The value passed should follow the syntax, expected by the Format(string, params object[]) method: { index[,alignment][:formatString] }.
When the ScalePrimitive control is used in a RadRangeSlider control,
its
LabelPlacement
Gets or sets the position of the labels relative to the axis line.
Declaration
public ScaleElementPlacement LabelPlacement { get; set; }
Property Value
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="LabelPlacement" Value="BottomRight"/>
<Setter Property="LineStyle">
<Setter.Value>
<Style TargetType="Rectangle">
<Setter Property="Stroke" Value="Red"/>
</Style>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
LabelStyle
Gets or sets the style that defines the appearance of all labels of the scale.
Declaration
public Style LabelStyle { get; set; }
Property Value
Style
Remarks
The Style should have ="TextBlock".
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="LabelStyle">
<Setter.Value>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="15"/>
<Setter Property="Foreground" Value="Green"/>
</Style>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
LabelTemplate
Gets or sets custom template for all labels of the scale.
Declaration
public DataTemplate LabelTemplate { get; set; }
Property Value
DataTemplate
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="LabelTemplate">
<Setter.Value>
<DataTemplate>
<Border BorderBrush="RoyalBlue" BorderThickness="2" CornerRadius="20" Width="40" Height="40" Margin="5">
<TextBlock Text="{Binding}" Foreground="Green" FontWeight="Black" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
LineStyle
Gets or sets the style that defines the appearance of the the axis line of the ScalePrimitive control.
Declaration
public Style LineStyle { get; set; }
Property Value
Style
Remarks
The Style should have ="".
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="LineStyle">
<Setter.Value>
<Style TargetType="Rectangle">
<Setter Property="Stroke" Value="Red"/>
</Style>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
Orientation
Gets or sets the orientation of the control.
Declaration
public Orientation Orientation { get; set; }
Property Value
Orientation
Remarks
When the ScalePrimitive control is used in a RadRangeSlider control, its Orientation property is set by the Orientation property.
TickFrequency
Gets or sets the logical tick frequency of the scale.
Declaration
public double TickFrequency { get; set; }
Property Value
Remarks
When the ScalePrimitive control is used in a RadRangeSlider control, its TickFrequency property is set by the TickFrequency property.
TickLength
Gets or sets the length of the scale ticks.
Declaration
public double TickLength { get; set; }
Property Value
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="TickLength" Value="10"/>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
TickPlacement
Gets or sets the position of the ticks relative to the axis line.
Declaration
public ScaleElementPlacement TickPlacement { get; set; }
Property Value
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="TickPlacement" Value="Center"/>
<Setter Property="LineStyle">
<Setter.Value>
<Style TargetType="Rectangle">
<Setter Property="Stroke" Value="Red"/>
</Style>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
TickStyle
Gets or sets the style defining the appearance of the scale ticks.
Declaration
public Style TickStyle { get; set; }
Property Value
Style
Remarks
The style should have ="".
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="TickStyle">
<Setter.Value>
<Style TargetType="Rectangle">
<Setter Property="Stroke" Value="Red"/>
<Setter Property="StrokeThickness" Value="2"/>
</Style>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
TickTemplate
Gets or sets a custom DataTemplate for the ticks.
Declaration
public DataTemplate TickTemplate { get; set; }
Property Value
DataTemplate
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="LabelPlacement" Value="BottomRight"/>
<Setter Property="TickPlacement" Value="TopLeft"/>
<Setter Property="TickTemplate">
<Setter.Value>
<DataTemplate>
<Ellipse Width="5" Height="5" Margin="-2.5,10,0,0" Fill="LimeGreen"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
TickThickness
Gets or sets the thickness of the scale ticks.
Declaration
public double TickThickness { get; set; }
Property Value
Example
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
<telerikInput:RadRangeSlider>
<telerikInput:RadRangeSlider.BottomRightScaleStyle>
<Style TargetType="telerikPrimitives:ScalePrimitive">
<Setter Property="TickThickness" Value="5"/>
</Style>
</telerikInput:RadRangeSlider.BottomRightScaleStyle>
</telerikInput:RadRangeSlider>
Methods
ApplyTemplateCore()
Called when the Framework is called. Inheritors should override this method should they have some custom template-related logic. This is done to ensure that the IsTemplateApplied property is properly initialized.
MeasureOverride(Size)
Called in the measure layout pass to determine the desired size.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
Size
The available size that was given by the layout system.
Returns
Size
Overrides
OnTemplateApplied()
Occurs when the method has been called and the template is already successfully applied.
Declaration
protected override void OnTemplateApplied()
Overrides
UnapplyTemplateCore()
Removes the current control template. Occurs when a template has already been applied and a new one is applied.
Declaration
protected override void UnapplyTemplateCore()
Overrides