Table of Contents

Interface IComboBoxBuilder

Namespace
BSGameLib.UI.Builder
Assembly
BSGameLib.UI.dll

A drop-down list, the ComboBox element of a view file, built in C#.

public interface IComboBoxBuilder : IControlBuilder<IComboBoxBuilder>
Inherited Members

Methods

BindOptions(string)

Binds the options to a view model property holding a list of key and display-text pairs.

IComboBoxBuilder BindOptions(string propertyName)

Parameters

propertyName string

Returns

IComboBoxBuilder

BindSelectedKey(string)

Binds the selected key to the view model property propertyName, and writes it back as the user picks.

IComboBoxBuilder BindSelectedKey(string propertyName)

Parameters

propertyName string

Returns

IComboBoxBuilder

ConfigureParts(Action<IComboBoxPartsBuilder<IComboBoxBuilder>>)

Configures the parts of the control: its box, arrow and drop-down list.

IComboBoxBuilder ConfigureParts(Action<IComboBoxPartsBuilder<IComboBoxBuilder>> configure)

Parameters

configure Action<IComboBoxPartsBuilder<IComboBoxBuilder>>

Returns

IComboBoxBuilder

WithFont(string)

Sets the font for the text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.

IComboBoxBuilder WithFont(string fontName)

Parameters

fontName string

Returns

IComboBoxBuilder

WithLabel(string)

Sets a label shown with the control. A "{Localize key}" shows that key's text in the current language.

IComboBoxBuilder WithLabel(string label)

Parameters

label string

Returns

IComboBoxBuilder

WithMaxDropdownHeight(float)

Sets the tallest the open list may grow, in pixels. Zero lets it size to its contents.

IComboBoxBuilder WithMaxDropdownHeight(float maxDropdownHeight)

Parameters

maxDropdownHeight float

Returns

IComboBoxBuilder

WithOptions(Action<IComboBoxOptionsBuilder<IComboBoxBuilder>>)

Adds the options written in the view, one AddOption call each.

IComboBoxBuilder WithOptions(Action<IComboBoxOptionsBuilder<IComboBoxBuilder>> configure)

Parameters

configure Action<IComboBoxOptionsBuilder<IComboBoxBuilder>>

Returns

IComboBoxBuilder

WithOptions(ObservableCollection<ComboBoxOption>)

Sets the options to the items the collection holds now. The list is copied, so later changes to the collection are not seen.

IComboBoxBuilder WithOptions(ObservableCollection<ComboBoxOption> options)

Parameters

options ObservableCollection<ComboBoxOption>

Returns

IComboBoxBuilder

WithSelectedKey(string)

Sets the key of the selected option.

IComboBoxBuilder WithSelectedKey(string key)

Parameters

key string

Returns

IComboBoxBuilder

WithSize(int, int)

Sets the control's size in pixels, as the Size attribute does.

IComboBoxBuilder WithSize(int width, int height)

Parameters

width int
height int

Returns

IComboBoxBuilder