In my mainpage.xaml I have a pivot control:
<Pivot x:Name="Pivot"
ItemsSource="{Binding PivotItems}"
ItemTemplate="{StaticResource PivotItemTemplate}">
</Pivot>
which binds it's items to a PivotsItems property on my viewmodel. The pivotitems are shown correctly but i'm not able to bind the content of the pivotitem.
My datatemplate looks like:
<DataTemplate x:Key="PivotItemTemplate">
<PivotItem>
<TextBlock Text="Test"></TextBlock>
</PivotItem>
</DataTemplate>
But no content is shown in any pivotitem.
What I wan't to do is to bind the pivotitems (which works) but show a seperate filter for each pivotitem. In this example I just want to show a TextBlock in each pivotitem.
SOLVED:
I defined the itemtemplate on the pivot control in the page, while i had to add it when populating the list in the vm:
PivotItems.Add(new PivotItem { Header = item.Key, ContentTemplate = App.Current.Resources["PivotItemTemplate"] as DataTemplate });