Styling the Suggestion List

AutoCompleteBox allows you to customize the presentation of suggestion items using its ItemTemplate property.

Sample code for this section is located in the AutoCompleteBoxTemplatedView and AutoCompleteBoxTemplatedViewModel.

So far a string has been used to represent suggestion items. This section uses a custom SuggestionItem class to demonstrate more complex data binding and styling features (see Listing 9.2).

LISTING 9.2. SuggestionItem Class

public class SuggestionItem{    public string Name { get; private set; }    public string Description { get; private set; }    public SuggestionItem(string name, string description)    {        Name = name;        Description = description;    } ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.