Seal Method
Collapse the table of content
Expand the table of content

Style.Seal Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

public void Seal()

A Style is sealed either when the Seal method is called on the Style or when the Style is applied to a FrameworkElement. When a Style is sealed, all the base styles it derives from up the inheritance chain are also sealed.

If you try to change the TargetType or a Setter in the style after it has been sealed, an InvalidOperationException is thrown.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft