I have a ListBox
on my WP 8.1 Silverlight app that looks like this:
<StackPanel Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Top">
<ListBox x:Name="FavoriteListBox" Visibility="Collapsed"
SelectionChanged="FavoriteListBox_SelectionChanged"
HorizontalAlignment="Stretch"
VerticalAlignment="Top" Opacity="1"
Background="{StaticResource PhoneBackgroundBrush}" Foreground="{StaticResource PhoneForegroundBrush}"
Height="300" Width="250">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Visibility="Visible" x:Name="FavoriteListBoxTextBlock"
FontSize="35" Foreground="Black" Text="{Binding AnswerName}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
In my ListBox
the items should look like this:
- item1
- item2
- to 15.....
However currently it is not in the order of 1,2,3,4... Instead it is in order of when the item is added.
I want the ListBox
items to serialize automatically. How can this be achieved?