Windows Phone 8 Panorama SelectionIndex not changing on swiping through items
- by Balraj Singh
I have created Panorama control and binded PanoramaItem from ItemSource. Now when i am changing the selected Panoramaitem by swiping over them the Selected index is always set to -1. I dont know what wrong i am doing while implementation. neither selectionchange event is getting fired.
Code:
<phone:Panorama Grid.Row="1" Visibility="Visible"
x:Name="PnrVwMainNews"
ItemsSource="{Binding ParnormaItemsData}"
ItemContainerStyle="{StaticResource PanoramaContainerItemStyle}">
<phone:Panorama.ItemTemplate>
<DataTemplate>
<!-- Panorma Items Template -->
<Controls:DynamicContentControl Content="{Binding UsrCntrlDynamic}" />
</DataTemplate>
</phone:Panorama.ItemTemplate>
</phone:Panorama>
PanoramaContainerItemStyle
<Style x:Key="PanoramaContainerItemStyle" TargetType="phone:PanoramaItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="phone:PanoramaItem">
<Grid Background="{TemplateBinding Background}" Margin="12,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>