Issue
I have a Listbox that I have bound to an ObservableCollection< string>:
Polls = new ObservableCollection<string>();
DataSet LoadAllPolls = _publisher.GetQuizFeatures(Global.gEpisodeWS.Id);
foreach (DataRow item in LoadAllPolls.Tables[0].Rows)
{
Polls.Add(item["Description"].ToString());
}
Here is the XAML:
<ListBox x:Name="lb_polls" Background="#ececec" BorderBrush="Transparent" SelectedItem="{Binding SelectedPoll}" ItemsSource="{Binding Polls}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Height" Value="110"/>
<Setter Property="Width" Value="200"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#858585" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#858585" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#858585"/>
</ListBox.Resources>
</ListBox>
Now i want the strings that are being added to the ListBox items to wrap. How can I do this?