Table of Contents

Class PrefabSource

Namespace
Bannerlord.UIExtenderEx.Runtimes
Assembly
Bannerlord.UIExtenderEx.dll

Exposes patched prefab XML data, widget factory state, and lifecycle invalidation events consumed by prefab runtimes.

Events fire on the thread that triggered the underlying operation (typically the main engine UI thread, except when background compilation workers parse prefabs). Event handler exceptions are caught and logged without propagating into TaleWorlds engine calls.

public static class PrefabSource
Inheritance
PrefabSource
Inherited Members

Properties

PatchedPrefabNames

Gets an immutable snapshot of all prefab names currently targeted by active patches across all registered module runtimes.

public static IReadOnlyCollection<string> PatchedPrefabNames { get; }

Property Value

IReadOnlyCollection<string>

RegisteredCustomTypeNames

Gets the names of all custom prefabs registered at runtime.

public static IEnumerable<string> RegisteredCustomTypeNames { get; }

Property Value

IEnumerable<string>

Methods

AddWidgetTypes(IEnumerable<Type>)

Registers newly discovered or dynamically compiled widget types directly into Gauntlet's internal widget lookup table (WidgetInfo._widgetInfos), avoiding costly full-assembly rescans.

public static void AddWidgetTypes(IEnumerable<Type> widgetTypes)

Parameters

widgetTypes IEnumerable<Type>

IsRegisteredCustomType(string)

Determines whether a custom prefab is registered at runtime under the specified name.

public static bool IsRegisteredCustomType(string name)

Parameters

name string

Returns

bool

TryGetRegisteredBuiltinType(string, out Type)

Attempts to resolve a widget Type registered by a mod at runtime under the specified name.

public static bool TryGetRegisteredBuiltinType(string name, out Type type)

Parameters

name string
type Type

Returns

bool

TryGetRegisteredCustomType(WidgetFactory, string, out WidgetPrefab)

Attempts to retrieve or instantiate a runtime-registered WidgetPrefab from the specified widget factory.

public static bool TryGetRegisteredCustomType(WidgetFactory widgetFactory, string name, out WidgetPrefab prefab)

Parameters

widgetFactory WidgetFactory
name string
prefab WidgetPrefab

Returns

bool

Events

EnvironmentChanged

Occurs when the UI environment changes in a manner that alters member or binding resolution (such as enabling, disabling, or deregistering mixins, or registering widget types).

public static event Action? EnvironmentChanged

Event Type

Action

Parsed

Occurs when a prefab has been parsed into a WidgetPrefab from an XmlDocument with all active patches applied.

public static event Action<WidgetPrefab, string, XmlDocument>? Parsed

Event Type

Action<WidgetPrefab, string, XmlDocument>

Registered

Occurs when a mod registers a custom prefab definition at runtime, superseding disk XML of the same name.

public static event Action<string>? Registered

Event Type

Action<string>

ReloadRequested

Occurs when prefabs are flagged for cache invalidation, forcing subsequent requests to parse XML afresh rather than reusing cached instances.

public static event Action<IReadOnlyList<string>>? ReloadRequested

Event Type

Action<IReadOnlyList<string>>

This page was last modified at 10/05/2026 13:34:58 +03:00 (UTC).

Commit Message
Author:    Vitalii Mikhailov
Commit:    f3b725a97c3f299c20e56b5f206e27142ec15edd
* Added C# Auto-Generated XML prefab compilation for patched and dynamic movies, matching vanilla UI performance

* Added name-based property binding fallback for ViewModel subtypes not declared on the parent
* Improved unparseable prefab error logging with name and file details
* Fixed game crash with 3-segment attribute paths
* Added Bannerlord.UIExtenderE...