Table of Contents

Class ZomboBase

Namespace
The.WPF.Controls
Assembly
Instagile.WPF.dll

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

DependencyProperty

IsDropDownOpenProperty

public static readonly DependencyProperty IsDropDownOpenProperty

Field Value

DependencyProperty

ItemContainersProperty

public static readonly DependencyProperty ItemContainersProperty

Field Value

DependencyProperty

ItemStringFormatProperty

public static readonly DependencyProperty ItemStringFormatProperty

Field Value

DependencyProperty

ItemsSourceProperty

public static readonly DependencyProperty ItemsSourceProperty

Field Value

DependencyProperty

MaxDropDownHeightProperty

public static readonly DependencyProperty MaxDropDownHeightProperty

Field Value

DependencyProperty

PART_TextBox

public TextBox? PART_TextBox

Field Value

TextBox

SelectedIndexProperty

public static readonly DependencyProperty SelectedIndexProperty

Field Value

DependencyProperty

TextBoxStyleProperty

public static readonly DependencyProperty TextBoxStyleProperty

Field Value

DependencyProperty

TextProperty

public static readonly DependencyProperty TextProperty

Field Value

DependencyProperty

UpdateItemsSourceCommandParameterProperty

public static readonly DependencyProperty UpdateItemsSourceCommandParameterProperty

Field Value

DependencyProperty

UpdateItemsSourceCommandProperty

public static readonly DependencyProperty UpdateItemsSourceCommandProperty

Field Value

DependencyProperty

UpdateItemsSourceDelayProperty

public static readonly DependencyProperty UpdateItemsSourceDelayProperty

Field Value

DependencyProperty

_HasKeyboardFocus

protected bool _HasKeyboardFocus

Field Value

bool

_Timer

protected readonly Timer _Timer

Field Value

Timer

Properties

DisplayMemberPath

public string? DisplayMemberPath { get; set; }

Property Value

string

IsDropDownOpen

public bool IsDropDownOpen { get; set; }

Property Value

bool

ItemContainers

public IReadOnlyList<ZomboBoxItem> ItemContainers { get; protected set; }

Property Value

IReadOnlyList<ZomboBoxItem>

ItemStringFormat

public string? ItemStringFormat { get; set; }

Property Value

string

ItemsSource

public IEnumerable? ItemsSource { get; set; }

Property Value

IEnumerable

MaxDropDownHeight

public double MaxDropDownHeight { get; set; }

Property Value

double

SelectedIndex

public int SelectedIndex { get; set; }

Property Value

int

Text

public string? Text { get; set; }

Property Value

string

TextBoxStyle

public Style? TextBoxStyle { get; set; }

Property Value

Style

UpdateItemsSourceCommand

public ICommand? UpdateItemsSourceCommand { get; set; }

Property Value

ICommand

UpdateItemsSourceCommandParameter

public object? UpdateItemsSourceCommandParameter { get; set; }

Property Value

object

UpdateItemsSourceDelay

public TimeSpan? UpdateItemsSourceDelay { get; set; }

Property Value

TimeSpan?

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

item object
forIndex int

Returns

ZomboBoxItem

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

IEnumerable<object>

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

e KeyboardFocusChangedEventArgs

The 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

item ZomboBoxItem

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

e KeyboardFocusChangedEventArgs

The 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

e KeyEventArgs

The 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

item object

Returns

object

UpdateSuggestions()

protected void UpdateSuggestions()