Class ThemeResources

Namespace
Forma.Xaml
Assembly
Forma.dll

Applies a named theme to a view's resources. The HTML and CSS dialect emits a token's overrides as name@theme resources (from :root[data-theme="dark"] or @media (prefers-color-scheme: dark)) and its original value as name@default; Apply(Control, string) copies the chosen set over the base keys, so every live var(--name) follows, and records the theme as the root's data-theme attribute so [data-theme="dark"] selectors match.

public static class ThemeResources
Inheritance
ThemeResources
Inherited Members

Methods

Apply(Control, string)

Applies theme (null or "default" restores the original values).

public static void Apply(Control root, string theme)

Parameters

root Control
theme string