Class Style
Contains property setters that can be shared between instances of a type.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public class Style : DependencyObject, IDependencyObject
Constructors
| Improve this Doc View SourceStyle()
Initializes a new instance of the Style class.
Declaration
public Style()
Style(Type)
Initializes a new instance of the Style class to use on the specified System.Type.
Declaration
public Style(Type targetType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The type to which the style will apply. |
Properties
| Improve this Doc View SourceBasedOn
Gets or sets a defined style that is the basis of the current style.
Declaration
public Style BasedOn { get; set; }
Property Value
Type | Description |
---|---|
Style | A defined style that is the basis of the current style. The default value is null. |
IsSealed
Gets a value that indicates whether the style is read-only and cannot be changed.
Declaration
public bool IsSealed { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the style is read-only; otherwise, false. |
Setters
Gets a collection of Setter objects.
Declaration
public SetterBaseCollection Setters { get; }
Property Value
Type | Description |
---|---|
SetterBaseCollection | A collection of Setter objects. The default is an empty collection. |
TargetType
Gets or sets the type for which the style is intended.
Declaration
public Type TargetType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The type of object to which the style is applied. |
Methods
| Improve this Doc View SourceSeal()
Locks the style so that the TargetType property or any Setter in the Setters collection cannot be changed.
Declaration
public void Seal()