Table of Contents

Class SelectorVM<T>

Namespace
TaleWorlds.Core.ViewModelCollection.Selector
Assembly
TaleWorlds.Core.ViewModelCollection.dll
public class SelectorVM<T> : ViewModel, IViewModel, INotifyPropertyChanged where T : SelectorItemVM

Type Parameters

T
Inheritance
SelectorVM<T>
Implements
Derived
Inherited Members

Constructors

SelectorVM(IEnumerable<string>, int, Action<SelectorVM<T>>)

public SelectorVM(IEnumerable<string> list, int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

list IEnumerable<string>
selectedIndex int
onChange Action<SelectorVM<T>>

SelectorVM(IEnumerable<TextObject>, int, Action<SelectorVM<T>>)

public SelectorVM(IEnumerable<TextObject> list, int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

list IEnumerable<TextObject>
selectedIndex int
onChange Action<SelectorVM<T>>

SelectorVM(int, Action<SelectorVM<T>>)

public SelectorVM(int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

selectedIndex int
onChange Action<SelectorVM<T>>

Properties

HasSingleItem

[DataSourceProperty]
public bool HasSingleItem { get; set; }

Property Value

bool

ItemList

[DataSourceProperty]
public MBBindingList<T> ItemList { get; set; }

Property Value

MBBindingList<T>

SelectedIndex

[DataSourceProperty]
public int SelectedIndex { get; set; }

Property Value

int

SelectedItem

[DataSourceProperty]
public T SelectedItem { get; set; }

Property Value

T

Methods

AddItem(T)

public void AddItem(T item)

Parameters

item T

ExecuteRandomize()

public void ExecuteRandomize()

ExecuteSelectNextItem()

public void ExecuteSelectNextItem()

ExecuteSelectPreviousItem()

public void ExecuteSelectPreviousItem()

GetCurrentItem()

public T GetCurrentItem()

Returns

T

Refresh(IEnumerable<string>, int, Action<SelectorVM<T>>)

public void Refresh(IEnumerable<string> list, int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

list IEnumerable<string>
selectedIndex int
onChange Action<SelectorVM<T>>

Refresh(IEnumerable<TextObject>, int, Action<SelectorVM<T>>)

public void Refresh(IEnumerable<TextObject> list, int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

list IEnumerable<TextObject>
selectedIndex int
onChange Action<SelectorVM<T>>

Refresh(IEnumerable<T>, int, Action<SelectorVM<T>>)

public void Refresh(IEnumerable<T> list, int selectedIndex, Action<SelectorVM<T>> onChange)

Parameters

list IEnumerable<T>
selectedIndex int
onChange Action<SelectorVM<T>>

RefreshValues()

public override void RefreshValues()

SetOnChangeAction(Action<SelectorVM<T>>)

public void SetOnChangeAction(Action<SelectorVM<T>> onChange)

Parameters

onChange Action<SelectorVM<T>>

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).