I´m struggling with data binding here for Windows Phone 7.1. I've got a DataLoader class with an OnservableCollection of ItemList (custom class) as an attribute. Therefore, each pivot item has its own list of items. In this DataLoader, I load the data from a JSON a JSON. So far, so good.
public ObservableCollection<ItemList> PivotItem { get; set; }
Here, I store five ItemList, one for each pivot header with his corresponding list of items.
But my problem is that I want to bind this data to the XAML with a ListBox within each PivotItem.
<phone:Pivot Title="iMetrópolis" Loaded="Pivot_Loaded">
<!--Elemento Pivot 1-->
<phone:PivotItem
x:Uid="PivotItem1"
Header="Todo" Margin="14,10,10,18">
<ListBox x:Name="FirstListBox" ItemsSource="{Binding Items}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432" Height="78">
// I want to add textboxes binding my data
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</phone:PivotItem>
.
.
.
Thanks for the replies!!
Here is what i think you need to do , an example for databinding
and a class for it
and binding real data from json
i hope it helps reply for any comments