Table of Contents

Class ViewModelMixinAttribute

Namespace
Bannerlord.UIExtenderEx.Attributes
Assembly
Bannerlord.UIExtenderEx.dll

Marks a class as a ViewModel mixin extending a target ViewModel.

Mixin classes must inherit from BaseViewModelMixin<TViewModel>. When attached, the mixin exposes its decorated properties and methods to the host ViewModel's Gauntlet data-binding context.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ViewModelMixinAttribute : BaseUIExtenderAttribute
Inheritance
ViewModelMixinAttribute
Inherited Members

Constructors

ViewModelMixinAttribute()

Initializes a new instance of ViewModelMixinAttribute with default configuration.

public ViewModelMixinAttribute()

ViewModelMixinAttribute(bool)

Initializes a new instance of ViewModelMixinAttribute specifying derived type handling.

public ViewModelMixinAttribute(bool handleDerived)

Parameters

handleDerived bool

true to attach to derived types; otherwise, false.

ViewModelMixinAttribute(string)

Initializes a new instance of ViewModelMixinAttribute with a designated refresh method name.

public ViewModelMixinAttribute(string refreshMethodName)

Parameters

refreshMethodName string

The name of the host ViewModel method that triggers OnRefresh().

ViewModelMixinAttribute(string?, bool)

Initializes a new instance of ViewModelMixinAttribute with both refresh method and derived type configuration.

public ViewModelMixinAttribute(string? refreshMethodName = null, bool handleDerived = false)

Parameters

refreshMethodName string

The name of the host ViewModel method that triggers OnRefresh().

handleDerived bool

true to attach to derived types; otherwise, false.

Properties

HandleDerived

Gets a value indicating whether this mixin attaches to all subtypes derived from the target ViewModel, in addition to the target type itself.

public bool HandleDerived { get; }

Property Value

bool

RefreshMethodName

Gets the name of the host ViewModel method (such as RefreshValues) whose execution triggers OnRefresh().

public string? RefreshMethodName { get; }

Property Value

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...