Show / Hide Table of Contents

Class AutoCompleteBox

Represents a control that provides a text box for user input and a drop-down that contains possible matches based on the input in the text box.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
AutoCompleteBox
Inherited Members
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Input.dll
Syntax
[TemplatePart(Name = "SelectionAdapter", Type = typeof(ISelectionAdapter))]
[TemplatePart(Name = "Selector", Type = typeof(Selector))]
[TemplatePart(Name = "Text", Type = typeof(TextBox))]
[TemplatePart(Name = "Popup", Type = typeof(Popup))]
[StyleTypedProperty(Property = "TextBoxStyle", StyleTargetType = typeof(TextBox))]
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(ListBox))]
public class AutoCompleteBox : Control, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

AutoCompleteBox()

Initializes a new instance of the AutoCompleteBox class.

Declaration
public AutoCompleteBox()

Fields

| Improve this Doc View Source

FilterModeProperty

Gets the identifier for the FilterMode dependency property.

Declaration
public static readonly DependencyProperty FilterModeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
Type Description
DependencyProperty

The identifier for the IsDropDownOpen dependency property.

| Improve this Doc View Source

IsTextCompletionEnabledProperty

Identifies the IsTextCompletionEnabled dependency property.

Declaration
public static readonly DependencyProperty IsTextCompletionEnabledProperty
Field Value
Type Description
DependencyProperty

The identifier for the IsTextCompletionEnabled dependency property.

| Improve this Doc View Source

ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type Description
DependencyProperty

The identifier for the ItemContainerStyle dependency property.

| Improve this Doc View Source

ItemFilterProperty

Identifies the ItemFilter dependency property.

Declaration
public static readonly DependencyProperty ItemFilterProperty
Field Value
Type Description
DependencyProperty

The identifier for the ItemFilter dependency property.

| Improve this Doc View Source

ItemsSourceProperty

Identifies the ItemsSource dependency property.

Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type Description
DependencyProperty

The identifier for the ItemsSource dependency property.

| Improve this Doc View Source

ItemTemplateProperty

Identifies the ItemTemplate dependency property.

Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type Description
DependencyProperty

The identifier for the ItemTemplate dependency property.

| Improve this Doc View Source

MaxDropDownHeightProperty

Identifies the MaxDropDownHeight dependency property.

Declaration
public static readonly DependencyProperty MaxDropDownHeightProperty
Field Value
Type Description
DependencyProperty

The identifier for the MaxDropDownHeight dependency property.

| Improve this Doc View Source

MinimumPopulateDelayProperty

Identifies the MinimumPopulateDelay dependency property.

Declaration
public static readonly DependencyProperty MinimumPopulateDelayProperty
Field Value
Type Description
DependencyProperty

The identifier for the MinimumPopulateDelay dependency property.

| Improve this Doc View Source

MinimumPrefixLengthProperty

Identifies the MinimumPrefixLength dependency property.

Declaration
public static readonly DependencyProperty MinimumPrefixLengthProperty
Field Value
Type Description
DependencyProperty

The identifier for the MinimumPrefixLength dependency property.

| Improve this Doc View Source

SearchTextProperty

Identifies the SearchText dependency property.

Declaration
public static readonly DependencyProperty SearchTextProperty
Field Value
Type Description
DependencyProperty

The identifier for the SearchText dependency property.

| Improve this Doc View Source

SelectedItemProperty

Identifies the SelectedItem dependency property.

Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
Type Description
DependencyProperty

The identifier the SelectedItem dependency property.

| Improve this Doc View Source

TextBoxStyleProperty

Identifies the TextBoxStyle dependency property.

Declaration
public static readonly DependencyProperty TextBoxStyleProperty
Field Value
Type Description
DependencyProperty

The identifier for the TextBoxStyle dependency property.

| Improve this Doc View Source

TextFilterProperty

Identifies the TextFilter dependency property.

Declaration
public static readonly DependencyProperty TextFilterProperty
Field Value
Type Description
DependencyProperty

The identifier for the TextFilter dependency property.

| Improve this Doc View Source

TextProperty

Identifies the Text dependency property.

Declaration
public static readonly DependencyProperty TextProperty
Field Value
Type Description
DependencyProperty

The identifier for the Text dependency property.

Properties

| Improve this Doc View Source

FilterMode

Gets or sets how the text in the text box is used to filter items specified by the ItemsSource property for display in the drop-down.

Declaration
public AutoCompleteFilterMode FilterMode { get; set; }
Property Value
Type Description
AutoCompleteFilterMode

One of the AutoCompleteFilterMode values The default is StartsWith.

Remarks

Use the FilterMode property to specify how possible matches are filtered. For example, possible matches can be filtered in a predefined or custom way. The search mode is automatically set to Custom if you set the ItemFilter property.

Exceptions
Type Condition
System.ArgumentException

The specified value is not a valid AutoCompleteFilterMode.

| Improve this Doc View Source

IsDropDownOpen

Gets or sets a value indicating whether the drop-down portion of the control is open.

Declaration
public bool IsDropDownOpen { get; set; }
Property Value
Type Description
System.Boolean

True if the drop-down is open; otherwise, false. The default is false.

| Improve this Doc View Source

IsTextCompletionEnabled

Gets or sets a value indicating whether the first possible match found during the filtering process will be displayed automatically in the text box.

Declaration
public bool IsTextCompletionEnabled { get; set; }
Property Value
Type Description
System.Boolean

True if the first possible match found will be displayed automatically in the text box; otherwise, false. The default is false.

| Improve this Doc View Source

ItemContainerStyle

Gets or sets the Style that is applied to the selection adapter contained in the drop-down portion of the AutoCompleteBox control.

Declaration
public Style ItemContainerStyle { get; set; }
Property Value
Type Description
Style

The Style applied to the selection adapter contained in the drop-down portion of the AutoCompleteBox control. The default is null.

Remarks

The default selection adapter contained in the drop-down is a ListBox control.

| Improve this Doc View Source

ItemFilter

Gets or sets the custom method that uses user-entered text to filter the items specified by the ItemsSource property for display in the drop-down.

Declaration
public AutoCompleteFilterPredicate<object> ItemFilter { get; set; }
Property Value
Type Description
AutoCompleteFilterPredicate<System.Object>

The custom method that uses the user-entered text to filter the items specified by the ItemsSource property. The default is null.

Remarks

The filter mode is automatically set to Custom if you set the ItemFilter property.

| Improve this Doc View Source

ItemsSource

Gets or sets a collection that is used to generate the items for the drop-down portion of the AutoCompleteBox control.

Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type Description
System.Collections.IEnumerable

The collection that is used to generate the items of the drop-down portion of the AutoCompleteBox control.

| Improve this Doc View Source

ItemTemplate

Gets or sets the DataTemplate used to display each item in the drop-down portion of the control.

Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type Description
DataTemplate

The DataTemplate used to display each item in the drop-down. The default is null.

Remarks

You use the ItemTemplate property to specify the visualization of the data objects in the drop-down portion of the AutoCompleteBox control. If your AutoCompleteBox is bound to a collection and you do not provide specific display instructions by using a DataTemplate, the resulting UI of each item is a string representation of each object in the underlying collection.

| Improve this Doc View Source

MaxDropDownHeight

Gets or sets the maximum height of the drop-down portion of the AutoCompleteBox control.

Declaration
public double MaxDropDownHeight { get; set; }
Property Value
Type Description
System.Double

The maximum height of the drop-down portion of the AutoCompleteBox control. The default is System.Double.PositiveInfinity.

Exceptions
Type Condition
System.ArgumentException

The specified value is less than 0.

| Improve this Doc View Source

MinimumPopulateDelay

Gets or sets the minimum delay, in milliseconds, after text is typed in the text box before the AutoCompleteBox control populates the list of possible matches in the drop-down.

Declaration
public int MinimumPopulateDelay { get; set; }
Property Value
Type Description
System.Int32

The minimum delay, in milliseconds, after text is typed in the text box, but before the AutoCompleteBox populates the list of possible matches in the drop-down. The default is 0.

Exceptions
Type Condition
System.ArgumentException

The set value is less than 0.

| Improve this Doc View Source

MinimumPrefixLength

Gets or sets the minimum number of characters required to be entered in the text box before the AutoCompleteBox displays possible matches. matches.

Declaration
public int MinimumPrefixLength { get; set; }
Property Value
Type Description
System.Int32

The minimum number of characters to be entered in the text box before the AutoCompleteBox displays possible matches. The default is 1.

Remarks

If you set MinimumPrefixLength to -1, the AutoCompleteBox will not provide possible matches. There is no maximum value, but setting MinimumPrefixLength to value that is too large will prevent the AutoCompleteBox from providing possible matches as well.

| Improve this Doc View Source

SearchText

Gets the text that is used to filter items in the ItemsSource item collection.

Declaration
public string SearchText { get; }
Property Value
Type Description
System.String

The text that is used to filter items in the ItemsSource item collection.

Remarks

The SearchText value is typically the same as the Text property, but is set after the TextChanged event occurs and before the Populating event.

| Improve this Doc View Source

SelectedItem

Gets or sets the selected item in the drop-down.

Declaration
public object SelectedItem { get; set; }
Property Value
Type Description
System.Object

The selected item in the drop-down.

Remarks

If the IsTextCompletionEnabled property is true and text typed by the user matches an item in the ItemsSource collection, which is then displayed in the text box, the SelectedItem property will be a null reference.

| Improve this Doc View Source

SelectionAdapter

Gets or sets the selection adapter used to populate the drop-down with a list of selectable items.

Declaration
protected ISelectionAdapter SelectionAdapter { get; set; }
Property Value
Type Description
ISelectionAdapter

The selection adapter used to populate the drop-down with a list of selectable items.

Remarks

You can use this property when you create an automation peer to use with AutoCompleteBox or deriving from AutoCompleteBox to create a custom control.

| Improve this Doc View Source

Text

Gets or sets the text in the text box portion of the AutoCompleteBox control.

Declaration
public string Text { get; set; }
Property Value
Type Description
System.String

The text in the text box portion of the AutoCompleteBox control.

| Improve this Doc View Source

TextBoxStyle

Gets or sets the Style applied to the text box portion of the AutoCompleteBox control.

Declaration
public Style TextBoxStyle { get; set; }
Property Value
Type Description
Style

The Style applied to the text box portion of the AutoCompleteBox control. The default is null.

| Improve this Doc View Source

TextFilter

Gets or sets the custom method that uses the user-entered text to filter items specified by the ItemsSource property in a text-based way for display in the drop-down.

Declaration
public AutoCompleteFilterPredicate<string> TextFilter { get; set; }
Property Value
Type Description
AutoCompleteFilterPredicate<System.String>

The custom method that uses the user-entered text to filter items specified by the ItemsSource property in a text-based way for display in the drop-down.

Remarks

The search mode is automatically set to Custom if you set the TextFilter property.

| Improve this Doc View Source

ValueMemberBinding

Gets or sets the Binding that is used to get the values for display in the text portion of the AutoCompleteBox control.

Declaration
public Binding ValueMemberBinding { get; set; }
Property Value
Type Description
Binding

The Binding object used when binding to a collection property.

| Improve this Doc View Source

ValueMemberPath

Gets or sets the property path that is used to get values for display in the text portion of the AutoCompleteBox control.

Declaration
public string ValueMemberPath { get; set; }
Property Value
Type Description
System.String

The property path that is used to get values for display in the text portion of the AutoCompleteBox control.

Methods

| Improve this Doc View Source

ArrangeOverride(Size)

Arranges and sizes the AutoCompleteBox control and its contents.

Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type Name Description
Size finalSize

The size allowed for the AutoCompleteBox control.

Returns
Type Description
Size

The finalSize, unchanged.

Overrides
Control.ArrangeOverride(Size)
| Improve this Doc View Source

FormatValue(Object)

Converts the specified object to a string by using the Converter and ConverterCulture values of the binding object specified by the ValueMemberBinding property.

Declaration
protected virtual string FormatValue(object value)
Parameters
Type Name Description
System.Object value

The object to format as a string.

Returns
Type Description
System.String

The string representation of the specified object.

Remarks

Override this method to provide a custom string conversion.

| Improve this Doc View Source

GetSelectionAdapterPart()

Returns the ISelectionAdapter part, if possible.

Declaration
protected virtual ISelectionAdapter GetSelectionAdapterPart()
Returns
Type Description
ISelectionAdapter

A ISelectionAdapter object, if possible. Otherwise, null.

| Improve this Doc View Source

HasFocus()

Determines whether the text box or drop-down portion of the AutoCompleteBox control has focus.

Declaration
protected bool HasFocus()
Returns
Type Description
System.Boolean

true to indicate the AutoCompleteBox has focus; otherwise, false.

| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the AutoCompleteBox control when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnCreateAutomationPeer()

Returns a AutoCompleteBoxAutomationPeer for use by the Silverlight automation infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

A AutoCompleteBoxAutomationPeer for the AutoCompleteBox object.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnDropDownClosed(RoutedPropertyChangedEventArgs<Boolean>)

Raises the DropDownClosed event.

Declaration
protected virtual void OnDropDownClosed(RoutedPropertyChangedEventArgs<bool> e)
Parameters
Type Name Description
RoutedPropertyChangedEventArgs<System.Boolean> e

A RoutedPropertyChangedEventArgs<T> which contains the event data.

| Improve this Doc View Source

OnDropDownClosing(RoutedPropertyChangingEventArgs<Boolean>)

Raises the DropDownClosing event.

Declaration
protected virtual void OnDropDownClosing(RoutedPropertyChangingEventArgs<bool> e)
Parameters
Type Name Description
RoutedPropertyChangingEventArgs<System.Boolean> e

A RoutedPropertyChangingEventArgs<T> that contains the event data.

| Improve this Doc View Source

OnDropDownOpened(RoutedPropertyChangedEventArgs<Boolean>)

Raises the DropDownOpened event.

Declaration
protected virtual void OnDropDownOpened(RoutedPropertyChangedEventArgs<bool> e)
Parameters
Type Name Description
RoutedPropertyChangedEventArgs<System.Boolean> e

A RoutedPropertyChangedEventArgs<T> that contains the event data.

| Improve this Doc View Source

OnDropDownOpening(RoutedPropertyChangingEventArgs<Boolean>)

Raises the DropDownOpening event.

Declaration
protected virtual void OnDropDownOpening(RoutedPropertyChangingEventArgs<bool> e)
Parameters
Type Name Description
RoutedPropertyChangingEventArgs<System.Boolean> e

A RoutedPropertyChangingEventArgs<T> that contains the event data.

| Improve this Doc View Source

OnGotFocus(RoutedEventArgs)

Provides handling for the GotFocus event.

Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

A RoutedEventArgs that contains the event data.

Overrides
Control.OnGotFocus(RoutedEventArgs)
| Improve this Doc View Source

OnKeyDown(KeyEventArgs)

Provides handling for the KeyDown event.

Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type Name Description
KeyEventArgs e

A KeyEventArgs that contains the event data.

Overrides
UIElement.OnKeyDown(KeyEventArgs)
| Improve this Doc View Source

OnLostFocus(RoutedEventArgs)

Provides handling for the LostFocus event.

Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

A RoutedEventArgs that contains the event data.

Overrides
Control.OnLostFocus(RoutedEventArgs)
| Improve this Doc View Source

OnPopulated(PopulatedEventArgs)

Raises the Populated event.

Declaration
protected virtual void OnPopulated(PopulatedEventArgs e)
Parameters
Type Name Description
PopulatedEventArgs e

A PopulatedEventArgs that contains the event data.

| Improve this Doc View Source

OnPopulating(PopulatingEventArgs)

Raises the Populating event.

Declaration
protected virtual void OnPopulating(PopulatingEventArgs e)
Parameters
Type Name Description
PopulatingEventArgs e

A PopulatingEventArgs that contains the event data.

| Improve this Doc View Source

OnSelectionChanged(SelectionChangedEventArgs)

Raises the SelectionChanged event.

Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
Type Name Description
SelectionChangedEventArgs e

A SelectionChangedEventArgs that contains the event data.

| Improve this Doc View Source

OnTextChanged(RoutedEventArgs)

Raises the TextChanged event.

Declaration
protected virtual void OnTextChanged(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

A RoutedEventArgs that contains the event data.

| Improve this Doc View Source

PopulateComplete()

Notifies the AutoCompleteBox that the ItemsSource property has been set and the data can be filtered to provide possible matches in the drop-down.

Declaration
public void PopulateComplete()
Remarks

Call this method when you are providing custom population of the drop-down portion of the AutoCompleteBox, to signal the control that you are done with the population process. Typically, you use PopulateComplete when the population process is a long-running process and you want to cancel built-in filtering of the ItemsSource items. In this case, you can handle the Populated event and set PopulatingEventArgs.Cancel to true. When the long-running process has completed you call PopulateComplete to indicate the drop-down is populated.

Events

| Improve this Doc View Source

DropDownClosed

Occurs when the IsDropDownOpen property was changed from true to false and the drop-down is open.

Declaration
public event RoutedPropertyChangedEventHandler<bool> DropDownClosed
Event Type
Type Description
RoutedPropertyChangedEventHandler<System.Boolean>
| Improve this Doc View Source

DropDownClosing

Occurs when the IsDropDownOpen property is changing from true to false.

Declaration
public event RoutedPropertyChangingEventHandler<bool> DropDownClosing
Event Type
Type Description
RoutedPropertyChangingEventHandler<System.Boolean>
| Improve this Doc View Source

DropDownOpened

Occurs when the value of the IsDropDownOpen property has changed from false to true and the drop-down is open.

Declaration
public event RoutedPropertyChangedEventHandler<bool> DropDownOpened
Event Type
Type Description
RoutedPropertyChangedEventHandler<System.Boolean>
| Improve this Doc View Source

DropDownOpening

Occurs when the value of the IsDropDownOpen property is changing from false to true.

Declaration
public event RoutedPropertyChangingEventHandler<bool> DropDownOpening
Event Type
Type Description
RoutedPropertyChangingEventHandler<System.Boolean>
| Improve this Doc View Source

Populated

Occurs when the AutoCompleteBox has populated the drop-down with possible matches based on the Text property.

Declaration
public event PopulatedEventHandler Populated
Event Type
Type Description
PopulatedEventHandler
| Improve this Doc View Source

Populating

Occurs when the AutoCompleteBox is populating the drop-down with possible matches based on the Text property.

Declaration
public event PopulatingEventHandler Populating
Event Type
Type Description
PopulatingEventHandler
Remarks

If the event is canceled, by setting the PopulatingEventArgs.Cancel property to true, the AutoCompleteBox will not automatically populate the selection adapter contained in the drop-down. In this case, if you want possible matches to appear, you must provide the logic for populating the selection adapter.

| Improve this Doc View Source

SelectionChanged

Occurs when the selected item in the drop-down portion of the AutoCompleteBox has changed.

Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
Type Description
SelectionChangedEventHandler
| Improve this Doc View Source

TextChanged

Occurs when the text in the text box portion of the AutoCompleteBox changes.

Declaration
public event RoutedEventHandler TextChanged
Event Type
Type Description
RoutedEventHandler

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source