共用方式為


Style.IsSealed Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets a value that indicates whether the style is read-only and cannot be changed.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public ReadOnly Property IsSealed As Boolean
public bool IsSealed { get; }

Property Value

Type: System.Boolean
true if the style is read-only; otherwise, false.

Remarks

You can change the values of individual properties that have been set within a style. For example, you can set the Template property at run time even if this property has been set by a style. Or you can add setters to the collection in Setters. However, as soon as that style is placed in use by a loaded object, the Style should be considered sealed. You can detect this state by checking the value of IsSealed for the Style. A style is considered to be in use as soon as it is referenced by a loaded object that is connected to the object tree and the Silverlight root visual. This point in time can be detected when the object where the Style property is set raises its Loaded event.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.