Class Theme
Provides a base class for defining themes.
Inheritance
Inherited Members
Namespace: OpenSilver.Theming
Assembly: OpenSilver.dll
Syntax
public abstract class Theme
Constructors
| Improve this Doc View SourceTheme()
Initializes a new instance of the Theme class.
Declaration
protected Theme()
Properties
| Improve this Doc View SourceBasedOn
Gets or sets a defined theme that is the basis of the current theme.
Declaration
public Theme BasedOn { get; set; }
Property Value
Type | Description |
---|---|
Theme | A defined theme that is the basis of the current theme. The default value is null. |
IsSealed
Gets a value that indicates whether the theme is read-only and cannot be changed.
Declaration
public bool IsSealed { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the theme is sealed; otherwise, false. |
Resources
Gets or sets the locally-defined resource dictionary.
Declaration
public ResourceDictionary Resources { get; set; }
Property Value
Type | Description |
---|---|
ResourceDictionary | The current locally-defined dictionary of resources, where each resource can be accessed by key. |
Methods
| Improve this Doc View SourceCheckSealed()
Throws an exception if the theme has already been sealed.
Declaration
protected void CheckSealed()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The theme has already been sealed. |
GenerateResources(Assembly)
Generates resources for a specific assembly.
Declaration
protected abstract ResourceDictionary GenerateResources(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to generate resources for. |
Returns
Type | Description |
---|---|
ResourceDictionary | A ResourceDictionary that contains resources for |
OnSealed()
Invoked after this theme becomes sealed.
Declaration
protected virtual void OnSealed()
Seal()
Locks the theme so it cannot be changed.
Declaration
public void Seal()