Class
ScalePrimitive

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:

cs-api-definition
public class ScalePrimitive : RangeControlBase

Inheritance: objectRadControlRadHeaderedControlRangeControlBaseScalePrimitive

Inherited Members RangeControlBase.MinimumPropertyRangeControlBase.MaximumPropertyRangeControlBase.OnCreateAutomationPeer()RangeControlBase.MinimumRangeControlBase.MaximumRadHeaderedControl.HeaderPropertyRadHeaderedControl.HeaderTemplatePropertyRadHeaderedControl.HeaderStylePropertyRadHeaderedControl.HeaderRadHeaderedControl.HeaderTemplateRadHeaderedControl.HeaderStyleRadControl.EndVisualStateUpdate(bool, bool)RadControl.UpdateVisualState(bool)RadControl.BeginVisualStateUpdate()RadControl.SetVisualState(string, bool)RadControl.CanUpdateVisualState()RadControl.ComposeVisualStateName()RadControl.ArrangeOverride(Size)RadControl.OnApplyTemplate()RadControl.OnIsEnabledChanged(bool, bool)RadControl.LoadCore()RadControl.OnLoaded()RadControl.UnloadCore()RadControl.CurrentVisualStateRadControl.IsLoadedRadControl.IsLoadingRadControl.IsUnloadedRadControl.WasUnloadedRadControl.IsTemplateApplied

Constructors

ScalePrimitive()

Initializes a new instance of the ScalePrimitive class.

Declaration

cs-api-definition
public ScalePrimitive()

Fields

LabelFormatProperty

Identifies the LabelFormat property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelFormatProperty

Field Value

DependencyProperty

LabelPlacementProperty

Identifies the LabelPlacement property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelPlacementProperty

Field Value

DependencyProperty

LabelStyleProperty

Identifies the LabelStyle property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelStyleProperty

Field Value

DependencyProperty

LabelTemplateProperty

Identifies the LabelTemplate property.

Declaration

cs-api-definition
public static readonly DependencyProperty LabelTemplateProperty

Field Value

DependencyProperty

LineStyleProperty

Identifies the LineStyle property.

Declaration

cs-api-definition
public static readonly DependencyProperty LineStyleProperty

Field Value

DependencyProperty

OrientationProperty

Identifies the Orientation property.

Declaration

cs-api-definition
public static readonly DependencyProperty OrientationProperty

Field Value

DependencyProperty

TickFrequencyProperty

Identifies the TickFrequency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TickFrequencyProperty

Field Value

DependencyProperty

TickLengthProperty

Identifies the TickThickness property.

Declaration

cs-api-definition
public static readonly DependencyProperty TickLengthProperty

Field Value

DependencyProperty

TickPlacementProperty

Identifies the TickPlacement property.

Declaration

cs-api-definition
public static readonly DependencyProperty TickPlacementProperty

Field Value

DependencyProperty

TickStyleProperty

Identifies the TickStyle property.

Declaration

cs-api-definition
public static readonly DependencyProperty TickStyleProperty

Field Value

DependencyProperty

TickTemplateProperty

Identifies the TickTemplate property.

Declaration

cs-api-definition
public static readonly DependencyProperty TickTemplateProperty

Field Value

DependencyProperty

TickThicknessProperty

Identifies the TickThickness property.

Declaration

cs-api-definition
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

cs-api-definition
public string LabelFormat { get; set; }

Property Value

string

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 LabelFormat property is set by the LabelFormat property.

LabelPlacement

Gets or sets the position of the labels relative to the axis line.

Declaration

cs-api-definition
public ScaleElementPlacement LabelPlacement { get; set; }

Property Value

ScaleElementPlacement

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public Style LabelStyle { get; set; }

Property Value

Style

Remarks

The Style should have ="TextBlock".

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public DataTemplate LabelTemplate { get; set; }

Property Value

DataTemplate

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public Style LineStyle { get; set; }

Property Value

Style

Remarks

The Style should have ="".

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
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

cs-api-definition
public double TickFrequency { get; set; }

Property Value

double

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

cs-api-definition
public double TickLength { get; set; }

Property Value

double

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public ScaleElementPlacement TickPlacement { get; set; }

Property Value

ScaleElementPlacement

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public Style TickStyle { get; set; }

Property Value

Style

Remarks

The style should have ="".

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public DataTemplate TickTemplate { get; set; }

Property Value

DataTemplate

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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

cs-api-definition
public double TickThickness { get; set; }

Property Value

double

Example

xaml
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"
xmlns:telerikPrimitives="using:Telerik.UI.Xaml.Controls.Primitives"
xaml
<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.

Declaration

cs-api-definition
protected override bool ApplyTemplateCore()

Returns

bool

Overrides RadControl.ApplyTemplateCore()

MeasureOverride(Size)

Called in the measure layout pass to determine the desired size.

Declaration

cs-api-definition
protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize

Size

The available size that was given by the layout system.

Returns

Size

Overrides RadControl.MeasureOverride(Size)

OnTemplateApplied()

Occurs when the method has been called and the template is already successfully applied.

Declaration

cs-api-definition
protected override void OnTemplateApplied()

Overrides RangeControlBase.OnTemplateApplied()

UnapplyTemplateCore()

Removes the current control template. Occurs when a template has already been applied and a new one is applied.

Declaration

cs-api-definition
protected override void UnapplyTemplateCore()

Overrides RadControl.UnapplyTemplateCore()