Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.PlayerThemeScopeBinding Class Referencesealed

Owns reversible player-theme mappings for a bounded framework visual subtree. More...

Inheritance diagram for GWG.WindowFramework.Theming.PlayerThemeScopeBinding:
Collaboration diagram for GWG.WindowFramework.Theming.PlayerThemeScopeBinding:

Public Member Functions

 PlayerThemeScopeBinding (VisualElement root, PlayerThemeValues values)
 Registers an exclusive subtree scope and maps currently present controls.
void Dispose ()
 Restores owned overrides and removes this root from the scope registry.
void Refresh ()
 Reconciles known controls after explicit owner notifications.

Static Public Member Functions

static void RefreshControl (VisualElement element)
 Refreshes only existing bindings for a control whose visual state changed.

Properties

bool IsDisposed [get]
 Gets whether detach or explicit disposal released this scope.

Private Member Functions

IDisposable Bind (VisualElement element)
void Detach (DetachFromPanelEvent evt)
void Visit (VisualElement element, HashSet< VisualElement > present)

Private Attributes

readonly Dictionary< VisualElement, IDisposable > _bindings = new Dictionary<VisualElement, IDisposable>()
bool _disposed
readonly VisualElement _root
readonly PlayerThemeValues _values

Static Private Attributes

static readonly List< PlayerThemeScopeBinding > Instances = new List<PlayerThemeScopeBinding>()
static readonly HashSet< VisualElement > Scopes = new HashSet<VisualElement>()

Detailed Description

Owns reversible player-theme mappings for a bounded framework visual subtree.

Maps implemented window, modal/card, tooltip/menu, tab, settings-row and native-control roles plus Button states using canonical values and public inline styles. This is not an arbitrary USS selector interpreter. Nested registered roots are excluded from ancestor ownership. Construction and explicit Refresh traverse the subtree; no per-frame scan occurs. Call Refresh after changing structure/classes/state, and dispose before imported textures. Root detachment disposes the scope; recreate it on later attachment. Descendant labels/buttons matching these rules can be styled even when they are application-created. Use explicit compiled extension ownership for unsupported custom roles rather than competing palettes.

Constructor & Destructor Documentation

◆ PlayerThemeScopeBinding()

GWG.WindowFramework.Theming.PlayerThemeScopeBinding.PlayerThemeScopeBinding ( VisualElement root,
PlayerThemeValues values )
inline

Registers an exclusive subtree scope and maps currently present controls.

Parameters
rootExplicit scope root, with nested scopes handled independently.
valuesAuthoritative resolved values for this scope.
Exceptions
ArgumentNullExceptionArguments are null.
InvalidOperationExceptionRoot already has a scope.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ Bind()

IDisposable GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Bind ( VisualElement element)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Detach()

void GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Detach ( DetachFromPanelEvent evt)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose()

void GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Dispose ( )
inline

Restores owned overrides and removes this root from the scope registry.

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

◆ Refresh()

void GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Refresh ( )
inline

Reconciles known controls after explicit owner notifications.

Releases removed/nested-scope controls and applies mappings to newly added ones.

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

◆ RefreshControl()

void GWG.WindowFramework.Theming.PlayerThemeScopeBinding.RefreshControl ( VisualElement element)
inlinestatic

Refreshes only existing bindings for a control whose visual state changed.

Parameters
elementExact native element; no controller/config lookup or tree scan.
Here is the caller graph for this function:

◆ Visit()

void GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Visit ( VisualElement element,
HashSet< VisualElement > present )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _bindings

readonly Dictionary<VisualElement, IDisposable> GWG.WindowFramework.Theming.PlayerThemeScopeBinding._bindings = new Dictionary<VisualElement, IDisposable>()
private

◆ _disposed

bool GWG.WindowFramework.Theming.PlayerThemeScopeBinding._disposed
private

◆ _root

readonly VisualElement GWG.WindowFramework.Theming.PlayerThemeScopeBinding._root
private

◆ _values

readonly PlayerThemeValues GWG.WindowFramework.Theming.PlayerThemeScopeBinding._values
private

◆ Instances

readonly List<PlayerThemeScopeBinding> GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Instances = new List<PlayerThemeScopeBinding>()
staticprivate

◆ Scopes

readonly HashSet<VisualElement> GWG.WindowFramework.Theming.PlayerThemeScopeBinding.Scopes = new HashSet<VisualElement>()
staticprivate

Property Documentation

◆ IsDisposed

bool GWG.WindowFramework.Theming.PlayerThemeScopeBinding.IsDisposed
get

Gets whether detach or explicit disposal released this scope.