Back to Devexpress

DigitalGaugeControl Class

wpf-devexpress-dot-xpf-dot-gauges-afe9d7ea.md

latest7.7 KB
Original Source

DigitalGaugeControl Class

A digital gauge control shipped with the DXGauge Suite.

Namespace : DevExpress.Xpf.Gauges

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

NuGet Package : DevExpress.Wpf.Gauges

Declaration

csharp
[DXLicenseWpf]
public class DigitalGaugeControl :
    GaugeControlBase
vb
<DXLicenseWpf>
Public Class DigitalGaugeControl
    Inherits GaugeControlBase

Remarks

The DigitalGaugeControl class is a visual gauge control that can display text or numbers much like a LED device.

The following images show some examples of a digital gauge.

7 segments view typeMatrix 5x8 view type

A gauge control is comprised of separate elements, such as symbols panel, symbols, segments, matrix cells, etc. To learn more about them, refer to the Visual Elements (Digital Gauge) section.

Example

This example demonstrates how to create a DigitalGaugeControl instance and customize its settings.

View Example

xaml
<Window x:Class="Digital_Gauge.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 everyone!!!" 
                                  Height="150" Padding="7">
            <!--region #Layers-->
            <dxga:DigitalGaugeControl.Layers>
                <dxga:DigitalGaugeLayer>
                    <dxga:DigitalGaugeLayer.Presentation>
                        <dxga:ClassicDigitalGaugeBackgroundLayerPresentation/>
                    </dxga:DigitalGaugeLayer.Presentation>
                </dxga:DigitalGaugeLayer>
            </dxga:DigitalGaugeControl.Layers>
            <!--endregion #Layers-->
            <!--region #Model-->
            <dxga:DigitalGaugeControl.Model>
                <dxga:DigitalFutureModel />
            </dxga:DigitalGaugeControl.Model>
            <!--endregion #Model-->
            <dxga:DigitalGaugeControl.SymbolView>
                <dxga:MatrixView8x14>
                    <!--region #MatrixOptions-->
                    <dxga:MatrixView8x14.Options>
                        <dxga:SymbolOptions SkewAngleX="5" SkewAngleY="5" />
                    </dxga:MatrixView8x14.Options>
                    <!--endregion #MatrixOptions-->
                    <!--region #MatrixAnimation-->
                    <dxga:MatrixView8x14.Animation>
                        <dxga:CreepingLineAnimation RefreshTime="00:00:00.2000000"
                                                    Repeat="True" />
                    </dxga:MatrixView8x14.Animation>
                    <!--endregion #MatrixAnimation-->
                </dxga:MatrixView8x14>
            </dxga:DigitalGaugeControl.SymbolView>
        </dxga:DigitalGaugeControl>
    </Grid>
</Window>
xaml
<Window x:Class="Digital_Gauge.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 everyone!!!" 
                                  Height="150" Padding="7">
            <!--region #Layers-->
            <dxga:DigitalGaugeControl.Layers>
                <dxga:DigitalGaugeLayer>
                    <dxga:DigitalGaugeLayer.Presentation>
                        <dxga:ClassicDigitalGaugeBackgroundLayerPresentation/>
                    </dxga:DigitalGaugeLayer.Presentation>
                </dxga:DigitalGaugeLayer>
            </dxga:DigitalGaugeControl.Layers>
            <!--endregion #Layers-->
            <!--region #Model-->
            <dxga:DigitalGaugeControl.Model>
                <dxga:DigitalFutureModel />
            </dxga:DigitalGaugeControl.Model>
            <!--endregion #Model-->
            <dxga:DigitalGaugeControl.SymbolView>
                <dxga:MatrixView8x14>
                    <!--region #MatrixOptions-->
                    <dxga:MatrixView8x14.Options>
                        <dxga:SymbolOptions SkewAngleX="5" SkewAngleY="5" />
                    </dxga:MatrixView8x14.Options>
                    <!--endregion #MatrixOptions-->
                    <!--#region #MatrixAnimation-->
                    <dxga:MatrixView8x14.Animation>
                        <dxga:CreepingLineAnimation RefreshTime="00:00:00.2000000"
                                                    Repeat="True" />
                    </dxga:MatrixView8x14.Animation>
                    <!--#endregion #MatrixAnimation-->
                </dxga:MatrixView8x14>
            </dxga:DigitalGaugeControl.SymbolView>
        </dxga:DigitalGaugeControl>
    </Grid>
</Window>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DigitalGaugeControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-gauges-set-width-and-height-of-symbols-in-digital-gauge-control/CS/MainWindow.xaml#L7

xml
<Grid>
    <dxga:DigitalGaugeControl Text="Hello!!!"
                              VerticalAlignment="Center">

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control GaugeControlBase DigitalGaugeControl

See Also

DigitalGaugeControl Members

DevExpress.Xpf.Gauges Namespace