StateIndicator.States Property

Contains states for the state indicator.

Namespace: DevExpress.XtraGauges.Core.Model

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

Declaration

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

Property Value

Type Description
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.

Examples

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:

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});

Implements

DevExpress.XtraGauges.Core.Model.IStateIndicator.States
See Also