Style<T>

A named, reusable set of property setters for views of type T.
public sealed class Style<T> : IStyle where T : View
Type parameterSummary
View TThe view type the style configures.

Constructors

Creates a style from a block of setters over the typed view.

public Style(
  Action<T> setters)
ParameterSummary
Action<T> settersThe block of setters to run against the view.

Creates a style that runs basedOn first, then its own setters over the top.

public Style(
  IStyle basedOn,
  Action<T> setters)
ParameterSummary
IStyle basedOnThe base style to inherit from.
Action<T> settersThe block of setters to run over the base style.

Exceptions

Properties

TargetType

The view type the style configures.

Type: Type

public Type TargetType { get; }

Methods

Apply

Runs the style's setters against view.

public void Apply(
  View view)
ParameterSummary
View viewThe view instance to configure.