Docs · API reference · Verso
ThemeEngine Class#
Manages the active theme and implements IThemeContext by delegating to the currently active ITheme extension.
public sealed class ThemeEngine : Verso.Abstractions.IThemeContext
Inheritance System.Object → ThemeEngine
Implements IThemeContext
Properties#
ActiveTheme Property#
Gets the currently active theme, or null if no theme is active.
public Verso.Abstractions.ITheme? ActiveTheme { get; }
Property Value#
AvailableThemes Property#
Gets the list of available themes.
public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ITheme> AvailableThemes { get; }
Property Value#
System.Collections.Generic.IReadOnlyList<ITheme>
Methods#
Refresh(IReadOnlyList<ITheme>) Method#
Replaces the available themes list with an updated snapshot. Preserves the active theme if it still exists in the new list.
public void Refresh(System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ITheme> updatedThemes);
Parameters#
updatedThemes System.Collections.Generic.IReadOnlyList<ITheme>
SetActiveTheme(string) Method#
Switches the active theme by theme ID.
public void SetActiveTheme(string themeId);
Parameters#
themeId System.String
Events#
OnThemeChanged Event#
Raised when the active theme changes.
public event Action<ITheme>? OnThemeChanged;