Class ComboBox
The ComboBox element of a view file: a drop-down list of options.
public class ComboBox : Control, IValidatableObject
- Inheritance
-
ComboBox
- Implements
- Inherited Members
Properties
Font
The font for the text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.
public string Font { get; set; }
Property Value
Label
A label shown with the control. A "{Localize key}" shows that key's text in the current language.
public string Label { get; set; }
Property Value
MaxDropdownHeight
The tallest the open list may grow, in pixels. Zero lets it size to its contents. It is also capped by the room below the control.
[Range(0, 3.4028234663852886E+38)]
public float MaxDropdownHeight { get; set; }
Property Value
Options
The options written in the view file. The control shows them in SortIndex order.
public List<ComboBoxOption> Options { get; set; }
Property Value
OptionsSource
A binding to a list of key and display-text pairs, for options the view file cannot know. Replaces Options when both are given.
public string OptionsSource { get; set; }
Property Value
Parts
The parts that make up the combo box: its box, arrow and drop-down list.
public ComboBoxParts Parts { get; set; }
Property Value
SelectedKey
The key of the selected option: a literal, or a binding that follows a view model property and writes it back.
public string SelectedKey { get; set; }
Property Value
Size
The control's size in pixels.
[Required]
public Size Size { get; set; }
Property Value
SizeValue
The Size attribute's text form. See Size.
public string SizeValue { get; set; }
Property Value
Methods
Validate(ValidationContext)
Reports an error unless the combo box has options, in Options or in OptionsSource.
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
validationContextValidationContext