Reputation: 1878
Is it possible to bind different models to different PivotItems in a Pivot-Control?
My PivotItems are
And on both pages I Need different data to Show with different DataTemplates. If yes, can someone show a simple sample?
Upvotes: 1
Views: 133
Reputation: 482
If you want your PivotItems to be managed from the different ViewModels, all you have to do is assign each PivotItem with dedicated ViewModel, e.g.:
<Pivot x:Name="PivotContro>
<PivotItem x:Name="Page1" DataContext="{Binding FirstViewModel, Source={StaticResource ViewModelProvider}}" />
<PivotItem x:Name="Page2" DataContext="{Binding SecondViewModel, Source={StaticResource ViewModelProvider}}" />
</Pivot>
Upvotes: 1