In Windows Phone 8, the LongListSelector LayoutMode to List and IsGroupingEnabled for false parameters should display your anchor data data as a flat list, as in the version of the WP7 Toolkit control.
For example,
Given the Entity class
public class Entity { public string Name { get; set; } public string Info { get; set; } public int ID { get; set; } }
All I have to do is create an ObservableCollection Entity on my page and bind it to the data source of my LongListSelector (named list).
ObservableCollection<Entity> data = new ObservableCollection<Entity>(); list.ItemsSourdce = data;
Then I create entities and add them to the collection.
Here is the XAML for my LongListSelector:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <phone:LongListSelector Name="list" HorizontalAlignment="Left" Height="609" VerticalAlignment="Top" Width="456" LayoutMode="List" IsGroupingEnabled="False" > <phone:LongListSelector.ItemTemplate> <DataTemplate> <StackPanel VerticalAlignment="Top"> <TextBlock FontWeight="Bold" Text="{Binding Name}" /> <TextBlock Text="{Binding Info}" /> </StackPanel> </DataTemplate> </phone:LongListSelector.ItemTemplate> </phone:LongListSelector> </Grid>
Strifex
source share