Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SymbolSegmentsMapping.SymbolType Property

Gets or sets a symbol type that is used for displaying a custom symbol on a digital gauge control.

Namespace: DevExpress.Xpf.Gauges

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

NuGet Package: DevExpress.Wpf.Gauges

#Declaration

public SymbolType SymbolType { get; set; }

#Property Value

Type Description
SymbolType

A SymbolType enumeration value that specifies a symbol type for custom symbol mapping.

Available values:

Name Description
Main

A main symbol is displayed in its own segment.

DigitalGauge_MainSymbolType

Additional

An additional symbol is displayed in the same segment with the previous character.

DigitalGauge_AdditionalSymbolType

#Remarks

Use the SymbolType property to specify a symbol type in custom symbol mapping. For example, depending on the symbol type, two custom symbols can be displayed either on separate segments or a common segment.

#Example

This example demonstrates how to display custom characters on a DigitalGaugeControl. This is done via the Custom Symbol Mapping feature that defines which segments should be activated for every custom character.

In this sample we will display “HELLO.” using the 7 Segment View type. Note that, by default, these characters can’t be displayed in this view (because 7 segments are not enough to provide unique representations for all Latin characters), but some characters can be efficiently displayed via custom symbol mapping.

For this, it is necessary to use the SymbolSegmentsMapping.SegmentsStates property to specify appropriate segment states for every desired character. In our case, these will be the following characters: “H”, “E”, “L”, “O”, “.” Note that for the dot character, we set the SymbolSegmentsMapping.SymbolType property value to Additional, so that it will be displayed in the same segment with the previous character.

Then, we specify the text that should be displayed on the segments panel via the DigitalGaugeControl.Text property.

Gauges - CustomSymbolMapping

<Window x:Class="CustomSymbolMapping.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxga:DigitalGaugeControl Name="digitalGaugeControl1" Text="HELLO.">
            <dxga:DigitalGaugeControl.SymbolView>
                <dxga:SevenSegmentsView>
                    <dxga:SevenSegmentsView.CustomSymbolMapping>
                        <dxga:SymbolSegmentsMapping Symbol="H" SegmentsStates="0 1 1 0 1 1 1"/>
                        <dxga:SymbolSegmentsMapping Symbol="E" SegmentsStates="1 0 0 1 1 1 1"/>
                        <dxga:SymbolSegmentsMapping Symbol="L" SegmentsStates="0 0 0 1 1 1 0"/>
                        <dxga:SymbolSegmentsMapping Symbol="O" SegmentsStates="1 1 1 1 1 1 0" />
                        <dxga:SymbolSegmentsMapping Symbol="." SegmentsStates="0 0 0 0 0 0 0 1" 
                                                               SymbolType="Additional"/>
                    </dxga:SevenSegmentsView.CustomSymbolMapping>
                </dxga:SevenSegmentsView>
            </dxga:DigitalGaugeControl.SymbolView>
        </dxga:DigitalGaugeControl>
    </Grid>
</Window>
See Also