Table of Contents

Interface IPropertyBinder

Namespace
PopcorningGuineaPig.Engine.Scenes
Assembly
PopcorningGuineaPig.Engine.dll

Trim-safe property-set adapter for a UI element type. Replaces the runtime element.GetType().GetProperty(name).SetValue(...) chain in the PGPSCN binding hot path with a strongly typed, allocation-free dispatch.

Two implementation paths exist:

  • The engine's built-in UI elements (Button, Label, Panel, etc.) are registered with UIElementBinderRegistry via the generic Register<T>() overload, which produces a reflection-based binder whose typeof(T) reflection site is [DynamicallyAccessedMembers]-pinned.
  • Game-defined custom UI elements implement this interface directly (typically via PropertyBinder<T>) and register with Register(Type, IPropertyBinder).

The two paths coexist: registry lookups return whichever binder was registered for the element's runtime Type.

public interface IPropertyBinder

Methods

TrySet(object, string, object)

Set propertyName on element to value. Returns true if the property was recognized and a write was attempted; false if the property name is unknown to this binder (the caller logs / no-ops).

bool TrySet(object element, string propertyName, object value)

Parameters

element object
propertyName string
value object

Returns

bool