Class ZomboBase
Base class for ZomboBox-style controls with text input, filtering, and dropdown suggestions.
public abstract class ZomboBase : ContentControl, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild
- Inheritance
-
ZomboBase
- Implements
- Derived
- Inherited Members
Constructors
ZomboBase()
protected ZomboBase()
Fields
DisplayMemberPathProperty
public static readonly DependencyProperty DisplayMemberPathProperty
Field Value
IsDropDownOpenProperty
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
ItemContainersProperty
public static readonly DependencyProperty ItemContainersProperty
Field Value
ItemStringFormatProperty
public static readonly DependencyProperty ItemStringFormatProperty
Field Value
ItemsSourceProperty
public static readonly DependencyProperty ItemsSourceProperty
Field Value
MaxDropDownHeightProperty
public static readonly DependencyProperty MaxDropDownHeightProperty
Field Value
PART_TextBox
public TextBox? PART_TextBox
Field Value
SelectedIndexProperty
public static readonly DependencyProperty SelectedIndexProperty
Field Value
TextBoxStyleProperty
public static readonly DependencyProperty TextBoxStyleProperty
Field Value
TextProperty
public static readonly DependencyProperty TextProperty
Field Value
UpdateItemsSourceCommandParameterProperty
public static readonly DependencyProperty UpdateItemsSourceCommandParameterProperty
Field Value
UpdateItemsSourceCommandProperty
public static readonly DependencyProperty UpdateItemsSourceCommandProperty
Field Value
UpdateItemsSourceDelayProperty
public static readonly DependencyProperty UpdateItemsSourceDelayProperty
Field Value
_HasKeyboardFocus
protected bool _HasKeyboardFocus
Field Value
_Timer
protected readonly Timer _Timer
Field Value
Properties
DisplayMemberPath
public string? DisplayMemberPath { get; set; }
Property Value
IsDropDownOpen
public bool IsDropDownOpen { get; set; }
Property Value
ItemContainers
public IReadOnlyList<ZomboBoxItem> ItemContainers { get; protected set; }
Property Value
ItemStringFormat
public string? ItemStringFormat { get; set; }
Property Value
ItemsSource
public IEnumerable? ItemsSource { get; set; }
Property Value
MaxDropDownHeight
public double MaxDropDownHeight { get; set; }
Property Value
SelectedIndex
public int SelectedIndex { get; set; }
Property Value
Text
public string? Text { get; set; }
Property Value
TextBoxStyle
public Style? TextBoxStyle { get; set; }
Property Value
UpdateItemsSourceCommand
public ICommand? UpdateItemsSourceCommand { get; set; }
Property Value
UpdateItemsSourceCommandParameter
public object? UpdateItemsSourceCommandParameter { get; set; }
Property Value
UpdateItemsSourceDelay
public TimeSpan? UpdateItemsSourceDelay { get; set; }
Property Value
Methods
ConfirmPendingSelection()
Called when Enter is pressed to confirm the current selection/text.
protected abstract void ConfirmPendingSelection()
CreateItemContainer(object?, int)
Creates a ZomboBoxItem container for the given item.
protected virtual ZomboBoxItem CreateItemContainer(object? item, int forIndex)
Parameters
Returns
ExecuteUpdateItemsSource()
protected void ExecuteUpdateItemsSource()
FlushPendingItemsSourceUpdate()
Cancels any pending debounced update and executes it immediately.
protected void FlushPendingItemsSourceUpdate()
GetFilteredItems()
Gets the items to display in the dropdown, possibly filtered.
protected virtual IEnumerable<object>? GetFilteredItems()
Returns
HandleFocusLoss()
Called when the control loses keyboard focus.
protected abstract void HandleFocusLoss()
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
eKeyboardFocusChangedEventArgsThe KeyboardFocusChangedEventArgs that contains the event data.
OnItemSelected(ZomboBoxItem)
Called when an item is selected via click or keyboard.
protected abstract void OnItemSelected(ZomboBoxItem item)
Parameters
itemZomboBoxItem
OnItemsSourceChanged()
protected virtual void OnItemsSourceChanged()
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.LostKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
eKeyboardFocusChangedEventArgsThe KeyboardFocusChangedEventArgs that contains event data.
OnPreviewKeyDown(KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
eKeyEventArgsThe KeyEventArgs that contains the event data.
OnTextChangedInternal()
Called when text changes while focused. Override to track text change state.
protected virtual void OnTextChangedInternal()
UnwrapItem(object?)
Unwraps a FallbackItemWrapper to its inner item, or returns the item as-is.
protected static object? UnwrapItem(object? item)
Parameters
itemobject
Returns
UpdateSuggestions()
protected void UpdateSuggestions()