Skip to main content

CustomArcScaleLayerPresentation.ScaleLayerTemplate Property

Gets or sets a template that configures the scale layer behavior and appearance. This is a dependency property.

Namespace: DevExpress.Xpf.Gauges

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

NuGet Package: DevExpress.Wpf.Gauges

Declaration

public ControlTemplate ScaleLayerTemplate { get; set; }

Property Value

Type Description
ControlTemplate

A control template that specifies the visual structure and behavior of the scale layer.

Example

This example demonstrates how to define a custom scale layer presentation.

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:GaugesDemoApp"
        xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges" 
        x:Class="GaugesDemoApp.MainWindow"
        Title="MainWindow" Height="300" Width="300">
    <Grid>
        <dxga:CircularGaugeControl>
            <dxga:CircularGaugeControl.Scales>
                <dxga:ArcScale ShowMinorTickmarks="False">
                    <dxga:ArcScale.Needles>
                        <dxga:ArcScaleNeedle/>
                    </dxga:ArcScale.Needles>
                    <dxga:ArcScale.MajorTickmarkOptions>
                        <dxga:MajorTickmarkOptions Offset="1" FactorLength="2" FactorThickness="2"/>
                    </dxga:ArcScale.MajorTickmarkOptions>
                    <dxga:ArcScale.TickmarksPresentation>
                        <dxga:DefaultTickmarksPresentation MajorTickBrush="White"/>
                    </dxga:ArcScale.TickmarksPresentation>
                    <dxga:ArcScale.Layers>
                        <dxga:ArcScaleLayer>
                            <dxga:ArcScaleLayer.Presentation>
                                <dxga:CustomArcScaleLayerPresentation>
                                    <dxga:CustomArcScaleLayerPresentation.ScaleLayerTemplate>
                                        <ControlTemplate>
                                            <Grid RenderTransformOrigin="0.5, 0.5">
                                                <Ellipse Fill="Gray"/>
                                                <Ellipse Fill="White" Margin="18"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </dxga:CustomArcScaleLayerPresentation.ScaleLayerTemplate>
                                </dxga:CustomArcScaleLayerPresentation>
                            </dxga:ArcScaleLayer.Presentation>
                        </dxga:ArcScaleLayer>
                    </dxga:ArcScale.Layers>
                </dxga:ArcScale>
            </dxga:CircularGaugeControl.Scales>
        </dxga:CircularGaugeControl>
    </Grid>
</Window> 

The image below illustrates the result.

See Also