All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

CustomStatePresentation Class

Contains presentation settings that specify the state appearance.

Namespace: DevExpress.Xpf.Gauges

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

Declaration

public class CustomStatePresentation :
    StatePresentation
Public Class CustomStatePresentation
    Inherits StatePresentation

Examples

This example demonstrates how to define a custom state indicator's state presentation.

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:GaugesDemoApp"
        xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges" 
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        x:Class="GaugesDemoApp.MainWindow"
        Title="MainWindow" Height="350" Width="300">
    <Grid>
        <StackPanel Orientation="Vertical">
            <dxga:StateIndicatorControl Foreground="White" StateIndex="{Binding ElementName=tbeStateIndex, Path=Value}">
                <dxga:StateIndicatorControl.AdditionalStates>
                    <dxga:State>
                        <dxga:State.Presentation>
                            <dxga:CustomStatePresentation>
                                <dxga:CustomStatePresentation.StateTemplate>
                                    <ControlTemplate>
                                        <Viewbox>
                                            <Border Background="Black">
                                                <TextBlock Text="$"/>
                                            </Border>
                                        </Viewbox>
                                    </ControlTemplate>
                                </dxga:CustomStatePresentation.StateTemplate>
                            </dxga:CustomStatePresentation>
                        </dxga:State.Presentation>
                    </dxga:State>
                    <dxga:State>
                        <dxga:State.Presentation>
                            <dxga:CustomStatePresentation>
                                <dxga:CustomStatePresentation.StateTemplate>
                                    <ControlTemplate>
                                        <Viewbox>
                                            <Border Background="Black">
                                                <TextBlock Text="¥"/>
                                            </Border>
                                        </Viewbox>
                                    </ControlTemplate>
                                </dxga:CustomStatePresentation.StateTemplate>
                            </dxga:CustomStatePresentation>
                        </dxga:State.Presentation>
                    </dxga:State>
                    <dxga:State>
                        <dxga:State.Presentation>
                            <dxga:CustomStatePresentation>
                                <dxga:CustomStatePresentation.StateTemplate>
                                    <ControlTemplate>
                                        <Viewbox>
                                            <Border Background="Black">
                                                <TextBlock Text="£"/>
                                            </Border>
                                        </Viewbox>
                                    </ControlTemplate>
                                </dxga:CustomStatePresentation.StateTemplate>
                            </dxga:CustomStatePresentation>
                        </dxga:State.Presentation>
                    </dxga:State>
                    <dxga:State>
                        <dxga:State.Presentation>
                            <dxga:CustomStatePresentation>
                                <dxga:CustomStatePresentation.StateTemplate>
                                    <ControlTemplate>
                                        <Viewbox>
                                            <Border Background="Black">
                                                <TextBlock Text="€"/>
                                            </Border>
                                        </Viewbox>
                                    </ControlTemplate>
                                </dxga:CustomStatePresentation.StateTemplate>
                            </dxga:CustomStatePresentation>
                        </dxga:State.Presentation>
                    </dxga:State>
                </dxga:StateIndicatorControl.AdditionalStates>
            </dxga:StateIndicatorControl>
            <dxe:TrackBarEdit Minimum="0" Maximum="3" TickFrequency="1" Height="20" Width="100" x:Name="tbeStateIndex"/>
        </StackPanel>
    </Grid>
</Window>

The image below illustrates the result.

See Also