Hi,
I want to bind a list box to a List, and here is my xaml code of the listbox:
<ListBox Name="RoutineList" Tap="RoutineList_Tap">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Name="routineName" Text="{Binding RoutineName}" FontSize="24"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Total Duration: " Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Name="totalDuration" Text="{Binding TotalDuration}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
and the code i used this to bind the data source:
this.RoutineList.ItemsSource = routineList;
the routineList is of type
List<routine></routine>
, and the
Routine
class have a property of RoutineName of type string, and TotalDuration of type int, and some other properties,
AFAIK, this should work in SL/WPF, but when i try to run this in the emulator, it only display the "Total Duration" which is defined in the xaml, without the value of the RoutinName or TotalDuration, but the number of the items in the listbox is equal to the number of items in the List, where did i do wrong?