Edit

Share via


Style Constructors

Definition

Initializes a new instance of the Style class.

Overloads

Style()

Initializes a new instance of the Style class.

Style(Type)

Initializes a new instance of the Style class to use on the specified Type.

Style(Type, Style)

Initializes a new instance of the Style class to use on the specified Type and based on the specified Style.

Style()

Initializes a new instance of the Style class.

C#
public Style();

Remarks

This constructor call requires delayed validation of TargetType and BasedOn style type. If this is used outside the context of the parser, behavior is undefined.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Style(Type)

Initializes a new instance of the Style class to use on the specified Type.

C#
public Style(Type targetType);

Parameters

targetType
Type

The type to which the style will apply.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Style(Type, Style)

Initializes a new instance of the Style class to use on the specified Type and based on the specified Style.

C#
public Style(Type targetType, System.Windows.Style basedOn);

Parameters

targetType
Type

The type to which the style will apply.

basedOn
Style

The style to base this style on.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10