Style Style Class

Definition

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

[Xamarin.Forms.ContentProperty("Setters")]
public sealed class Style
type Style = class
    interface IStyle
Inheritance
StyleStyle
Attributes

Remarks

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

Property Value
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.

Constructors

Style(Type) Style(Type)

Intitializes a new Style instance.

Properties

ApplyToDerivedTypes ApplyToDerivedTypes

Gets or sets a Boolean value that controls whether the style should be applied to controls that are derived from the base type.

BasedOn BasedOn

The Style on which this Style is based.

BaseResourceKey BaseResourceKey

Gets or sets the key that identifies the Style on which this Style is based.

Behaviors Behaviors

Gets the list of Behavior objects that belong to this Style.

CanCascade CanCascade

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.

Class Class

Gets or sets the class for the style.

Setters Setters

Gets the list of Setter objects that belong to this Style.

TargetType TargetType

Gets the type of object that this style can describe. See Remarks.

Triggers Triggers

Gets the list of Trigger objects that belong to this Style.

Extension Methods

LoadFromXaml<TXaml>(TXaml, String) LoadFromXaml<TXaml>(TXaml, String)

Returns an initialized view by loading the specified xaml.

LoadFromXaml<TXaml>(TXaml, Type) LoadFromXaml<TXaml>(TXaml, Type)

Returns a TXaml with the properties that are defined in the application manifest for callingType.

Applies to