Class Dropdown
A Selector with a fixed-text closed-state display (SelectedItem's display text) and letter-key typeahead - no free text entry.
public class Dropdown : Selector, INotifyPropertyChanging, IBindingTarget, INotifyPropertyChanged, INotifyFocusChanged, IContainerLayout, IVirtualizingScrollInfo
- Inheritance
-
Dropdown
- Implements
- Inherited Members
- Extension Methods
Remarks
Typeahead is driven by the raw KeyDown event, never
ITextEvents/EnableTextInput - a Dropdown never accepts
free text entry, so it must never put the input system into "text input" mode. On several platforms that
mode is what triggers an IME candidate window or an on-screen keyboard; enabling it just because a
Dropdown gained focus would surprise a user (e.g. someone typing in Japanese) with an IME
popup over a control that has nowhere to actually show composed text. ComboBox's internal
text box is the control that legitimately needs real text input and enables it accordingly.
Constructors
Dropdown()
Initializes a new instance of the Dropdown class.
public Dropdown()
Methods
OnApplyTemplate()
Called once, every time Template changes (in either direction - applied, cleared, or switched to a different template), right after Chrome and every decoration/content property have been fully re-wired for the new state.
protected override void OnApplyTemplate()
Remarks
Does nothing by default. A subclass that reaches into its own visual tree by reference - e.g. Slider wiring its drag logic directly to its thumb element - overrides this to call GetTemplateChild<T>(string) and repoint that reference to whatever the new Template (or, when reverting, the fresh default Border) actually provides, instead of hardcoding it once at construction. This is what actually makes a control "template-safe": until a control overrides this appropriately, applying a custom Template to it silently orphans whatever elements its own code still holds direct references to.