The first approach is to use ComboBox, as it already has this functionality. You can use the TextSearch function. To enable this feature, use this code (sorry, it's quick and dirty):
<ComboBox ItemsSource="{Binding AutoSuggestionVariants}"> <ComboBox.ItemContainerStyle> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="TextSearch.Text" Value="{Binding}" /> </Style> </ComboBox.ItemContainerStyle> </ComboBox>
In addition, if you need it, you can use the combo box to make it look like a text field (delete button and popup list).
Another approach is to use CollectionView. This article describes how to do the same function as TextSearch for the combo box. I think you can take this idea in a text box.
Hope this helps.
levanovd
source share