Skip to main content

Scale.CustomElements Property

Provides access to a collection of custom elements contained in the current Circular Scale or Linear Scale.

Namespace: DevExpress.Xpf.Gauges

Assembly: DevExpress.Xpf.Gauges.v22.2.dll

NuGet Package: DevExpress.Wpf.Gauges


public ScaleCustomElementCollection CustomElements { get; }

Property Value

Type Description

A ScaleCustomElementCollection object that contains scale custom elements.


Use the CustomElements property to add or remove custom elements to the current scale, as well as to customize different settings of individual custom elements. A single custom element is an instance of the ScaleCustomElement class and can be accessed via the GaugeDependencyObjectCollectionBase<T>.Item property of a ScaleCustomElementCollection object.


This example illustrates how to add two buttons as custom elements to the linear scale and use them to increase or decrease the current scale value.

For this, create two ScaleCustomElement objects and add a button control to each custom element.

Finally, to provide the capability for end-users to change the scale’s value, handle the button1_Click and button2_Click events and write code that will increment and decrement the scale value.

View Example

<Window x:Class="LinearGauge_CustomElement.MainWindow"
        Title="MainWindow" Height="450" Width="325">
        <dxga:LinearGaugeControl Name="linearGaugeControl1" Width="170" >
                <dxga:LinearScale >
                        <dxga:ScaleCustomElement VerticalAlignment="Top" HorizontalAlignment="Right">
                            <Button Name="button1" Content="Up" Width="40"  Click="button1_Click" />
                        <dxga:ScaleCustomElement VerticalAlignment="Bottom" HorizontalAlignment="Right">
                            <Button Name="button2" Content="Down" Width="40" Click="button2_Click" />
                    <dxga:LinearScale.LevelBars >
                        <dxga:LinearScaleLevelBar x:Name="bar"  Value="50" />
                    </dxga:LinearScale.LevelBars >
                        <dxga:LinearScaleLayer />
                <dxga:LinearCleanWhiteModel />
See Also