Saturday, 14 September 2013

Windows phone:access subproperty of binding

Windows phone:access subproperty of binding

I have a custom pivot control where all the UI is generated using
template.It looks like this:
<controls:Pivot ItemsSource="{Binding superSets}">
<controls:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</controls:Pivot.HeaderTemplate>
<controls:Pivot.ItemTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding Source={StaticResource
SortedNews}}">
<ListBox.ItemTemplate>
<!- datatemplate Code -->
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</controls:Pivot.ItemTemplate>
</controls:Pivot>
Now,I want to sort the contents of listbox so I designed a
collectionviewsource like this:
<CollectionViewSource x:Key="SortedNews" Source="{Binding Path=Articles}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription
PropertyName="Pubdate"></scm:SortDescription>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
About the superSets: It contains an Observable collection type property
Articles
Now when I run the program I get an error saying Property 'Articles' not
found
Any Ideas?

No comments:

Post a Comment