Show / Hide Table of Contents

Class Style

Contains property setters that can be shared between instances of a type.

Inheritance
System.Object
DependencyObject
Style
Inherited Members
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public class Style : DependencyObject, IDependencyObject

Constructors

| Improve this Doc View Source

Style()

Initializes a new instance of the Style class.

Declaration
public Style()
| Improve this Doc View Source

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 Source

BasedOn

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

Seal()

Locks the style so that the TargetType property or any Setter in the Setters collection cannot be changed.

Declaration
public void Seal()

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source