You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window for the application. You need to ensure that the following requirements are met:
* An array of strings is displayed by using a ListBox control in a two-column format.
* The data in the ListBox control flows from left to right and from top to bottom.
Which ListBox control would you use?
A.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString
B.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString
C.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myListView.ItemsSource = arrayOfString
D.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString