Interface IComboBoxBuilder
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
propertyNamestring
Returns
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
propertyNamestring
Returns
ConfigureParts(Action<IComboBoxPartsBuilder<IComboBoxBuilder>>)
Configures the parts of the control: its box, arrow and drop-down list.
IComboBoxBuilder ConfigureParts(Action<IComboBoxPartsBuilder<IComboBoxBuilder>> configure)
Parameters
configureAction<IComboBoxPartsBuilder<IComboBoxBuilder>>
Returns
WithFont(string)
Sets the font for the text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.
IComboBoxBuilder WithFont(string fontName)
Parameters
fontNamestring
Returns
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
labelstring
Returns
WithMaxDropdownHeight(float)
Sets the tallest the open list may grow, in pixels. Zero lets it size to its contents.
IComboBoxBuilder WithMaxDropdownHeight(float maxDropdownHeight)
Parameters
maxDropdownHeightfloat
Returns
WithOptions(Action<IComboBoxOptionsBuilder<IComboBoxBuilder>>)
Adds the options written in the view, one AddOption call each.
IComboBoxBuilder WithOptions(Action<IComboBoxOptionsBuilder<IComboBoxBuilder>> configure)
Parameters
configureAction<IComboBoxOptionsBuilder<IComboBoxBuilder>>
Returns
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
optionsObservableCollection<ComboBoxOption>
Returns
WithSelectedKey(string)
Sets the key of the selected option.
IComboBoxBuilder WithSelectedKey(string key)
Parameters
keystring
Returns
WithSize(int, int)
Sets the control's size in pixels, as the Size attribute does.
IComboBoxBuilder WithSize(int width, int height)