The DropDownEditBox control enables you to create ComboBox-like behavior using any controls and any type of data. Unlike a ComboBox, the DropDownEditBox is not restricted to a specific set of values. For example, the DropDownDatePicker is a DropDownEditBox control whose “edit box” is a DateTimePicker and whose “drop down” is a MonthCalendar.
You can use the DropDownEditBox to compose similar “compact” and “exploded” representations in other domains. For example you could create a color picker control which allows users to type RGB values or color names into the edit box, or select using swatches or sliders in the drop-down.
The DropDownEditBox doesn’t do much by itself: it simply provides a mechanism to show and hide a drop-down using a button. It is intended for use in composing simple controls into richer ones.
To use the DropDownEditBox, you will use the following properties:
- Content: the object to be edited. When using the DropDownEditBox to implement a composite control, the Content will typically be the composite control itself. For example, in the DropDownDatePicker, the internal DropDownEditBox has its Content bound to the DropDownDatePicker control.
- HeaderTemplate: a DataTemplate for the “compact” representation. In the DropDownDatePicker, this is a DateTimePicker.
- DropDownTemplate: a DataTemplate for the “exploded” representation, which will appear when the user clicks the drop-down button. In the DropDownDatePicker, this is a MonthCalendar.