AutoCompleteBox Control
The AutoCompleteBox controls acts much like the AutoCompleteExtender control found in the ASP.NET AJAX Control Toolkit. It allows data to be displayed under a TextBox as users type characters. The XAML code that follows defines an AutoCompleteBox control named acCountries that displays data after a user types a single character:
<controls:AutoCompleteBox x:Name="acCountries" MinimumPopulateDelay="200" MinimumPrefixLength="1" Width="260" HorizontalAlignment="Left" />
You can bind auto complete data to the control using the ItemsSource property:
private void BindData() { acCountries.ItemsSource = new List<string>() { "USA", "Spain", "Mexico", "Canada", "Costa Rica" }; }
Here's what the end user would see as they type "c" into the text box:
The AutoCompleteBox supports filtering auto complete data using Lambdas, exposes a rich set of properties and events and allows templates to be defined. Here's an example of applying a custom template to the control's ItemTemplate property to display pictures and text as the user types: