Skip to main content

CustomArcScaleNeedlePresentation Class

Contains presentation settings that specify the needle appearance.

Namespace: DevExpress.Xpf.Gauges

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

NuGet Package: DevExpress.Wpf.Gauges

Declaration

public class CustomArcScaleNeedlePresentation :
    ArcScaleNeedlePresentation

Example

This example demonstrates how to define a custom needle 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" ShowLine="True">
                    <dxga:ArcScale.Needles>
                        <dxga:ArcScaleNeedle Value="85" IsInteractive="True">
                            <dxga:ArcScaleNeedle.Presentation>
                                <dxga:CustomArcScaleNeedlePresentation>
                                    <dxga:CustomArcScaleNeedlePresentation.NeedleTemplate>
                                        <ControlTemplate>
                                            <Grid RenderTransformOrigin="0, 0.5" Margin="0,0,2,0" Height="24" Opacity="0.5">
                                                <Path HorizontalAlignment="Right" Fill="Black" Height="17" Width="20" VerticalAlignment="Center"
                                                  Data="M0,0 L20,8 L0,16 z"/>
                                                <Rectangle Fill="Black" Height="8" VerticalAlignment="Center" Margin="0,0,20,0"/>
                                                <Rectangle Fill="Black" Height="8" Width="30" HorizontalAlignment="Left" Margin="-30,0,0,0"/>
                                                <Path Fill="Black" Margin="-50,0,0,0" VerticalAlignment="Center" Width="30" Height="17" HorizontalAlignment="Left"
                                                  Data="M0,0 L20,0 L30,8 L20,17 L0,17 L10,8 L0,0 z"/>
                                                <Ellipse StrokeThickness="0" Fill="Red" HorizontalAlignment="Left" Margin="-10,0,0,0" Width="20" VerticalAlignment="Center" Height="20"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </dxga:CustomArcScaleNeedlePresentation.NeedleTemplate>
                                </dxga:CustomArcScaleNeedlePresentation>
                            </dxga:ArcScaleNeedle.Presentation>
                        </dxga:ArcScaleNeedle>
                    </dxga:ArcScale.Needles>
                </dxga:ArcScale>
            </dxga:CircularGaugeControl.Scales>
        </dxga:CircularGaugeControl>
    </Grid>
</Window>

The image below illustrates the result.

See Also