VisualState.Setters VisualState.Setters VisualState.Setters VisualState.Setters Property


Gets a collection of Setter objects that define discrete property values that control the appearance of UIElement s when this VisualState is applied.

public : SetterBaseCollection Setters { get; }
SetterBaseCollection Setters();
public SetterBaseCollection Setters { get; }
Public ReadOnly Property Setters As SetterBaseCollection

Property Value

A collection of Setter objects. The default is an empty collection.


The following example shows how to use multiple Setter statements inside the VisualState.Setters property to apply multiple discrete property value changes on 2 different elements when a VisualState is applied.

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
                <VisualState x:Name="NarrowState">
                        <Setter Target="myPanel.Orientation" Value="Vertical" />
                        <Setter Target="myPanel.Width" Value="380" />
                        <Setter Target="myTextBlock.MaxLines" Value="3" />
        <StackPanel x:Name="myPanel" Orientation="Horizontal">
            <TextBlock x:Name="myTextBlock" MaxLines="5" Style="{ThemeResource BodyTextBlockStyle}"/>


Use this property to make discrete property value changes on multiple UI elements at one time when a VisualState is applied.