wpf-devexpress-dot-xpf-dot-gauges-dot-stateindicatorcontrol-fdc15d04.md
Gets or sets the index of a state image that is currently displayed on the StateIndicatorControl.
Namespace : DevExpress.Xpf.Gauges
Assembly : DevExpress.Xpf.Gauges.v25.2.dll
NuGet Package : DevExpress.Wpf.Gauges
public int StateIndex { get; set; }
Public Property StateIndex As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value that is the current state index.
|
This example demonstrates how to create and customize a StateIndicatorControl.
using System.Windows;
using System.Windows.Input;
namespace DXGauges_StateIndicator {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
private void stateIndicatorControl1_MouseEnter(object sender, MouseEventArgs e) {
stateIndicatorControl1.StateIndex = 0;
}
private void stateIndicatorControl1_MouseLeave(object sender, MouseEventArgs e) {
stateIndicatorControl1.StateIndex = 2;
}
}
}
<Window x:Class="DXGauges_StateIndicator.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:StateIndicatorControl Name="stateIndicatorControl1" StateIndex="2"
MouseEnter="stateIndicatorControl1_MouseEnter"
MouseLeave="stateIndicatorControl1_MouseLeave">
<!--region #Model-->
<dxga:StateIndicatorControl.Model>
<dxga:SmileStateIndicatorModel />
</dxga:StateIndicatorControl.Model>
<!--endregion #Model-->
</dxga:StateIndicatorControl>
</Grid>
</Window>
Imports Microsoft.VisualBasic
Imports System.Windows
Imports System.Windows.Input
Namespace DXGauges_StateIndicator
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
Private Sub stateIndicatorControl1_MouseEnter(ByVal sender As Object, ByVal e As MouseEventArgs)
stateIndicatorControl1.StateIndex = 0
End Sub
Private Sub stateIndicatorControl1_MouseLeave(ByVal sender As Object, ByVal e As MouseEventArgs)
stateIndicatorControl1.StateIndex = 2
End Sub
End Class
End Namespace
See Also