Back to Devexpress

StateIndicator.States Property

corelibraries-devexpress-dot-xtragauges-dot-core-dot-model-dot-stateindicator.md

latest3.4 KB
Original Source

StateIndicator.States Property

Contains states for the state indicator.

Namespace : DevExpress.XtraGauges.Core.Model

Assembly : DevExpress.XtraGauges.v25.2.Core.dll

NuGet Package : DevExpress.Gauges.Core

Declaration

csharp
public virtual IndicatorStateCollection States { get; }
vb
Public Overridable ReadOnly Property States As IndicatorStateCollection

Property Value

TypeDescription
DevExpress.XtraGauges.Core.Model.IndicatorStateCollection

An IndicatorStateCollection that contains states for the state indicator.

|

Remarks

Use this property to create, modify and delete states for the state indicator. Each state identifies a specific image.

When a state indicitor is used within a StateIndicatorGauge, to select a specific state, use the StateIndicator.StateIndex property.

In linear and circular gauges, a state is automatically selected depending upon a scale’s current value (ArcScale.Value or LinearScale.Value). For state indicators being used in circular and linear gauges, you need to specify the range of values that correspond to specific states. If the value of the gauge’s scale falls into a specific range, a corresponding state is automatically activated.

Example

Images for state indicators are enumerated by the StateIndicatorShapeType type.

To add images to a state indicator, you need to add items to the StateIndicator.States collection. Each item’s ShapeType property is of the StateIndicatorShapeType type, and it refers to a specific image.

The following code shows how to add three states to a state indicator:

csharp
using DevExpress.XtraGauges.Core.Model;
// ...

IndicatorState state1 = new IndicatorState(StateIndicatorShapeType.FlagUSA);
IndicatorState state2 = new IndicatorState(StateIndicatorShapeType.FlagUK);
IndicatorState state3 = new IndicatorState(StateIndicatorShapeType.FlagAustralia);
stateIndicatorComponent1.States.AddRange(new IndicatorState[] {state1, state2, state3});
vb
Imports DevExpress.XtraGauges.Core.Model
' ...

Dim state1 As IndicatorState = New IndicatorState(StateIndicatorShapeType.FlagUSA)
Dim state2 As IndicatorState = New IndicatorState(StateIndicatorShapeType.FlagUK)
Dim state3 As IndicatorState = New IndicatorState(StateIndicatorShapeType.FlagAustralia)
stateIndicatorComponent1.States.AddRange(New IndicatorState() {state1, state2, state3})

See Also

StateIndex

StateIndicator Class

StateIndicator Members

DevExpress.XtraGauges.Core.Model Namespace