Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.PlayerThemeTokenCatalog Class Reference

Canonical friendly-key mapping for portable framework theme data. More...

Collaboration diagram for GWG.WindowFramework.Theming.PlayerThemeTokenCatalog:

Data Structures

class  Entry
 One friendly key, authoritative token and numeric validation bounds. More...

Public Types

enum  ValueKind { Color , Number , Image }
 Supported portable value categories. More...

Static Public Member Functions

static bool TryGet (string key, out Entry entry)
 Finds an exact case-sensitive friendly key.
static bool TrySnapshot (VisualElement scope, out PlayerThemeValues snapshot, out string[] unavailable)
 Reads effective theme values through public custom-style APIs without changing styles.
static bool TrySnapshot (VisualElement scope, PlayerThemeValues overrides, out PlayerThemeValues snapshot, out string[] unavailable)
 Captures resolved shipped values and overlays accepted player fields for an effective copy.

Properties

static IReadOnlyList< Entry > Entries = Array.AsReadOnly(Definitions) [get]
 Gets immutable mapping definitions, also suitable for generating field documentation.

Static Private Member Functions

static Entry C (string key, string token)
static Entry I (string key, string token)
static Entry N (string key, string token, float min, float max)
static bool TryReadDimension (VisualElement scope, Entry entry, out float value)

Static Private Attributes

static readonly Entry[] Definitions

Detailed Description

Canonical friendly-key mapping for portable framework theme data.

Contains no duplicate palette. Defaults are read from the active theme's resolved custom properties. Snapshot requires an attached, style-resolved element in the intended theme scope. This initial catalog covers colour, dimension and raster image roles; fonts, vectors and cursor semantics require separate validated handling.

Member Enumeration Documentation

◆ ValueKind

Supported portable value categories.

Enumerator
Color 
Number 
Image 

Member Function Documentation

◆ C()

Entry GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.C ( string key,
string token )
inlinestaticprivate

◆ I()

Entry GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.I ( string key,
string token )
inlinestaticprivate

◆ N()

Entry GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.N ( string key,
string token,
float min,
float max )
inlinestaticprivate

◆ TryGet()

bool GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.TryGet ( string key,
out Entry entry )
inlinestatic

Finds an exact case-sensitive friendly key.

Parameters
keyGrouped key.
entryDefinition when found.
Returns
True for a supported framework key.
Here is the caller graph for this function:

◆ TryReadDimension()

bool GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.TryReadDimension ( VisualElement scope,
Entry entry,
out float value )
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TrySnapshot() [1/2]

bool GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.TrySnapshot ( VisualElement scope,
out PlayerThemeValues snapshot,
out string[] unavailable )
inlinestatic

Reads effective theme values through public custom-style APIs without changing styles.

Parameters
scopeAttached element whose custom properties represent the active theme.
snapshotResolved values, including explicitly empty images.
unavailableKeys not available through this element's resolved custom styles.
Returns
True only when every catalog field was captured.

Missing values must be reported or resolved from authoritative source data, never filled with a hardcoded palette. Font/vector roles are not silently rasterized. Call after CustomStyleResolvedEvent/layout, not immediately after changing stylesheets.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TrySnapshot() [2/2]

bool GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.TrySnapshot ( VisualElement scope,
PlayerThemeValues overrides,
out PlayerThemeValues snapshot,
out string[] unavailable )
inlinestatic

Captures resolved shipped values and overlays accepted player fields for an effective copy.

Parameters
scopeAttached, style-resolved element in the intended baseline scope.
overridesValidated player fields, or null for a shipped theme.
snapshotComplete effective values only when successful.
unavailableMissing fields; callers must refuse incomplete export.
Returns
True if every supported role is present and within its portable limits.

No default palette is fabricated. Missing/corrupt imported overrides have already been omitted by recovery. Unsupported vector/font values remain reported rather than dropped.

Here is the call graph for this function:

Field Documentation

◆ Definitions

readonly Entry [] GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.Definitions
staticprivate

Property Documentation

◆ Entries

IReadOnlyList<Entry> GWG.WindowFramework.Theming.PlayerThemeTokenCatalog.Entries = Array.AsReadOnly(Definitions)
staticget

Gets immutable mapping definitions, also suitable for generating field documentation.