Skip to main content

RangeControl.LabelTemplate Property

Gets or sets the DataTemplate used to render the built-in labels that indicate the bound values of the selected range.

Namespace: DevExpress.Xpf.Editors.RangeControl

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public DataTemplate LabelTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object used to render the bound labels.

Remarks

The LabelTemplate property allows you to specify a DataTemplate used to render the built-in labels. Label visibility can be specified with the RangeControl.ShowLabels property.

Example

The following example shows how to declare a custom data template that renders the bound labels as TextBlocks.

In this example, the DataTemplate is assigned to the RangeControl.LabelTemplate property. This DataTemplate contains the TextBlock control which specifies the text attributes.

The following image shows the result.

RangeControl_LabelTemplate

xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"

<Window.Resources>
    <DataTemplate x:Key="labelTemplate">
        <TextBlock FontFamily="Segoe UI"
                   FontSize="12" 
                   FontWeight="Bold"
                   Foreground="Black" 
                   Background="Orange"
                   VerticalAlignment="Center"
                   Padding="10" 
                   Text="{Binding}"/>
    </DataTemplate>
</Window.Resources>

...

<dxe:RangeControl Name="rangeControl1" 
                  LabelTemplate="{StaticResource ResourceKey=labelTemplate}">
...
</dxe:RangeControl>
See Also