In a Windows Phone 7 page I have the following control:
<controls:Pivot x:Name="Pivoter" Title="{Binding Name}"
TitleTemplate="{StaticResource PivotTitleTemplate}"
HeaderTemplate="{StaticResource PivotHeaderTemplate}"
ItemsSource="{Binding Items}"
ItemTemplate="{StaticResource DisplayItemDataTemplate}">
</controls:Pivot >
with this DataTemplate:
<DataTemplate x:Key="DisplayItemDataTemplate">
<Image Grid.Column="0" Stretch="Uniform"
Source="{Binding LargeImage, Converter={StaticResource UriBitmapConverter}}"/>
<StackPanel Grid.Column="1" Orientation="Vertical">
<HyperlinkButton NavigateUri="{Binding Uri}" Content="{Binding Uri}"/>
</StackPanel>
</DataTemplate>
The ItemsSource
is an ObservableCollection
. When the page is displayed it creates all of the PivotItems
but the first item does not get created unless I scroll forward and back to it. It has an entry in the scroll list but no PivotItem
control.
If I put a break point in the Pivot Control's LoadingPivotItem
event it is not called when the pivot is first displayed but again only gets hit when I scroll away and back to the first item.
Has anybody seen similar behavior for the Pivot
control and have a work around? Or am I doing something incorrectly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…