Xamarin.Forms Guides | Samples

Xamarin.Forms.Style Class

Class that contains triggers, setters, and behaviors that completely or partially define the appearance and behavior of a class of visual elements.

See Also: Style

Syntax

[Xamarin.Forms.ContentProperty("Setters")]
public sealed class Style

Remarks

XAML for Xamarin.Forms supports the following properties for the Style class:

PropertyValue
BasedOn

A StaticResource markup extension that names the style on which this style is based.

BaseResourceKey

A resource dictionary key that names a dynamic base style.

Behaviors

Markup for the behaviors that are associated with the style.

Setters

A list of setters containing Property and Value elements or attributes.

TargetType

The name of the type that the style is intended for.

Triggers

A list of triggers.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.Style are listed below.

See Also: Object

Public Constructors

Intitializes a new Style instance.

Public Properties

ApplyToDerivedTypesBoolean. Gets or sets a Boolean value that controls whether the style should be applied to controls that are derived from the base type.
BasedOnStyle. The Style on which this Style is based.
BaseResourceKeyString. Gets or sets the key that identifies the Style on which this Style is based.
[read-only]
BehaviorsIList<Behavior>. Gets the list of Behavior objects that belong to this Style.
CanCascadeBoolean. Gets or sets a Boolean value that controls whether the style should cascade to controls that are children (in the visual hierarchy) of the parent type.
ClassString. Gets or sets the class for the style.
[read-only]
SettersIList<Setter>. Gets the list of Setter objects that belong to this Style.
[read-only]
TargetTypeType. Gets the type of object that this style can describe. See Remarks.
[read-only]
TriggersIList<TriggerBase>. Gets the list of Trigger objects that belong to this Style.