Skip to main content

SymbolLength(SymbolLengthType, Double) Constructor

Initializes a new instance of the SymbolLength class with the specified symbol length type and symbol length value.

Namespace: DevExpress.Xpf.Gauges

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

NuGet Package: DevExpress.Wpf.Gauges

Declaration

public SymbolLength(
    SymbolLengthType type,
    double length
)

Parameters

Name Type Description
type SymbolLengthType

A SymbolLengthType enumeration value that specifies the type of a symbol length. This value is assigned to the SymbolLength.Type property.

length Double

A Double value that specifies the symbol length. This value is assigned to either the SymbolLength.FixedLength or SymbolLength.ProportionalLength property, depending on the value passed as the type parameter.

Example

This example demonstrates how to specify the width and height of digital gauge symbols in fixed and proportional values.

For this, it is necessary to create an instance of the SymbolLength structure with required values and then assign it to the SymbolViewBase.Height and SymbolViewBase.Width properties.

In this example, the symbol length can be set either in fixed or proportional values depending on which of the buttons has been clicked.

View Example: Set the Width and Height of Symbols in the Digital Gauge Control

private void button1_Click(object sender, RoutedEventArgs e) {
    // Specify fixed values for symbol height and width.
    matrixView.Width = new SymbolLength(SymbolLengthType.Fixed, 44);
    matrixView.Height = new SymbolLength(SymbolLengthType.Fixed, 50);
}

private void button2_Click(object sender, RoutedEventArgs e) {
    // Specify proportional values for symbol height and width.
    matrixView.Width = new SymbolLength(SymbolLengthType.Proportional, 2);
    matrixView.Height = new SymbolLength(SymbolLengthType.Proportional, 5);
}
See Also