Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.IPlayerThemeExtension Interface Reference

Compiled purchaser-defined handler for one namespaced portable theme section. More...

Inheritance diagram for GWG.WindowFramework.Theming.IPlayerThemeExtension:

Public Member Functions

IDisposable Apply (VisualElement scope, string sectionJson)
 Applies already validated settings within an explicit scope.
string Snapshot (VisualElement scope)
 Exports current effective purchaser settings, including its authoritative defaults.
bool Validate (string sectionJson, out string error)
 Validates every supported key and explicit value without mutating UI or files.

Properties

string Namespace [get]
 Gets a stable dotted namespace, such as mygame.inventory.

Detailed Description

Compiled purchaser-defined handler for one namespaced portable theme section.

Application registers this capability before discovery; player JSON never creates it by type name. Validate and Snapshot are bounded data operations. Apply returns a reversible scoped lease. Asset-capable implementations also declare IPlayerThemeAssetExtension and use folder-aware import/application. Preserve unknown sections; never open unvalidated player paths.

Member Function Documentation

◆ Apply()

IDisposable GWG.WindowFramework.Theming.IPlayerThemeExtension.Apply ( VisualElement scope,
string sectionJson )

Applies already validated settings within an explicit scope.

Parameters
scopeApplication-provided subtree; do not modify unrelated panels.
sectionJsonValidated namespace object.
Returns
A non-null lease that reverses owned styling and releases owned resources.

Acquire resources transactionally. If this method throws, undo its own partial changes before throwing because the caller has no lease to release. Dispose must be idempotent, preserve newer caller overrides and never destroy caller-owned controls. Use panel attach/ detach lifecycle or application notifications for dynamic elements, not per-frame scans.

◆ Snapshot()

string GWG.WindowFramework.Theming.IPlayerThemeExtension.Snapshot ( VisualElement scope)

Exports current effective purchaser settings, including its authoritative defaults.

Parameters
scopeExplicit application UI scope whose values are being copied.
Returns
Standard JSON object containing this extension's complete editable snapshot.

Do not export Editor paths, type names or external URLs. The framework revalidates returned JSON and merges this namespace without discarding other extension sections.

◆ Validate()

bool GWG.WindowFramework.Theming.IPlayerThemeExtension.Validate ( string sectionJson,
out string error )

Validates every supported key and explicit value without mutating UI or files.

Parameters
sectionJsonStandard object JSON for this namespace only.
errorActionable bounded failure explanation; null on success.
Returns
True only when safe to apply.

Reject unsupported keys, nonfinite/out-of-range values and unsupported assets. Validation must be deterministic and free of resource acquisition or side effects.

Property Documentation

◆ Namespace

string GWG.WindowFramework.Theming.IPlayerThemeExtension.Namespace
get

Gets a stable dotted namespace, such as mygame.inventory.

Must not collide with another registered handler. Renaming breaks old section identity.