Sorry.. my english is so bad :'(
I wrote a messy xaml codes
<ScrollViewer>
<ItemsControl x:Name="REST0029" ItemsSource="{Binding MenuOfWeek}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding DayOfWeek}" />
<ItemsControl ItemsSource="{Binding Menus}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Type}" />
<ItemsControl ItemsSource="{Binding Meals}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding Price}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
And the below is my summary of class
MenuOfWeekPresenter
└ObservableCollection MenuOfWeek
MenuOfDay
└string DayOfWeek
└ObservableCollection menus
Menu
└string Type
└ObservableCollection meals
Meal
└string Name
└string Price
And I want to use {Binding Type} where,
<StackPanel>
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding Price}" />
</StackPanel>
For example,
<StackPanel>
<TextBlock Text="{Binding Type}" />
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding Price}" />
</StackPanel>
like that…
please help me..:'(
To accomplish this i think you would need to bind to the parents Datacontext and that is a bit tricky in Windows Phone 7 because it doesn’t know FindAncestor you would have to use a Binding helper.
Binding Helper Example