Class VisualState<TTarget>
A strongly-typed, fluent builder over VisualState, mirroring Style<TTarget>'s compile-time-checked property references for defining state setters in C# code.
public class VisualState<TTarget> : VisualState where TTarget : UIElement
Type Parameters
TTargetThe type of element this state is meant to be applied to.
- Inheritance
-
VisualState<TTarget>
- Inherited Members
- Extension Methods
Constructors
VisualState(ControlState)
Initializes a new instance of the VisualState<TTarget> class.
public VisualState(ControlState state)
Parameters
stateControlStateThe combination of ControlState flags this state responds to.
Methods
Set<TValue>(Expression<Func<TTarget, TValue>>, TValue)
Sets the value a property this state should have while active, and returns this state for further chaining.
public VisualState<TTarget> Set<TValue>(Expression<Func<TTarget, TValue>> property, TValue value)
Parameters
propertyExpression<Func<TTarget, TValue>>A simple property-access expression identifying the property to set, e.g.
x => x.Background.valueTValueThe value to set.
Returns
- VisualState<TTarget>
This state, for fluent chaining.
Type Parameters
TValueThe type of the property's value.