Skip to main content

AutoSuggestBox

Description​

Use AutoSuggestBox for search and autocomplete: handle TextChanged to filter suggestions and QuerySubmitted to act on the choice.

AutoSuggestBox in light mode AutoSuggestBox in dark mode

Open suggestions​

AutoSuggestBox suggestion list with entries in light mode AutoSuggestBox suggestion list with entries in dark mode

Example usage​

<fluence:AutoSuggestBox PlaceholderText="Search" ItemsSource="{Binding Suggestions}" />

Key properties​

PropertyDefaultPurpose
TextEmpty stringCurrent query text.
ItemsSourcenullSuggestion items.
TextMemberPathEmpty stringMember used as text for a suggestion.
IsSuggestionListOpenfalseControls suggestion popup state.
UpdateTextOnSelecttrueUpdates text when a suggestion is chosen.
MaxSuggestionListHeight374Maximum popup height.

State and behavior​

Handle TextChanged to filter ItemsSource; the control does not filter the collection automatically. Handle QuerySubmitted when the user submits text or chooses a suggestion.

Additional behavior​

AutoSuggestBox observes collection changes when its current ItemsSource implements INotifyCollectionChanged. Adding the first suggestion or removing the last one updates the popup without replacing the collection or the consumer's open-state binding.

Events​

TextChanged, SuggestionChosen, and QuerySubmitted report text changes, chosen items, and submitted queries.

See text input focus and selection for the shared WPF editor behavior.

Reference​