The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
AutoCompleteBox.ItemsSource Property
Silverlight
Gets or sets a collection that is used to generate the items for the drop-down portion of the AutoCompleteBox control.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.Input (in System.Windows.Controls.Input.dll)
<sdk:AutoCompleteBox ItemsSource="bindingDeclaration"/> -or- <sdk:AutoCompleteBox ItemsSource="resourceReferenceToIEnumerable"/>
XAML Values
Property Value
Type: System.Collections.IEnumerableThe collection that is used to generate the items of the drop-down portion of the AutoCompleteBox control.
The following example shows an AutoCompleteBox that provides a list of cities to complete an entry in its text box. This code example requires a reference to the System.Windows.Controls.Input assembly.
public Page() { InitializeComponent(); List<string> cities = new List<string>(); cities.Add("London"); cities.Add("Seattle"); cities.Add("Tokyo"); cities.Add("Nairobi"); cities.Add("Lisbon"); cities.Add("New York"); cities.Add("Paris"); cities.Add("San Francisco"); citiesACB.ItemsSource = cities; }
<Border BorderThickness="3" BorderBrush="Black"> <StackPanel Background="LightGray"> <TextBlock Text="AutoCompleteBox Control" Margin="5"/> <StackPanel x:Name="LayoutRoot" Orientation="Horizontal"> <TextBlock Text="Destination: " Margin="5" VerticalAlignment="Center" /> <sdk:AutoCompleteBox x:Name="citiesACB" Width="200" /> </StackPanel> </StackPanel> </Border>
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Community Additions
Show: