I am developing Windows Phone 8 application.Everything is pretty good , but i found one thing i have not handled beforehand - and now than Panorama Control behavior confuses me. Here`s simplified example of my application Hub Page (with Panorama Control):
Simplified page XAML is next :
<phone:Panorama>
<i:Interaction.Behaviors>
<b:PanoramaBehaviour/>
</i:Interaction.Behaviors>
<phone:PanoramaItem Header="Panorama1">
<ScrollViewer>
<StackPanel>
<Button Height="72" Content="Button1" Click="Button_Click"/>
<Button Height="72" Content="Button2" Click="Button_Click"/>
<Button Height="72" Content="Button3" Click="Button_Click"/>
<Button Height="72" Content="Button4" Click="Button_Click"/>
<Button Height="72" Content="Button5" Click="Button_Click"/>
<Button Height="72" Content="Button6" Click="Button_Click"/>
<Button Height="72" Content="Button7" Click="Button_Click"/>
<Button Height="72" Content="Button8" Click="Button_Click"/>
<Button Height="72" Content="Button9" Click="Button_Click"/>
</StackPanel>
</ScrollViewer>
</phone:PanoramaItem>
<phone:PanoramaItem Header="Panorama2">
<Grid Background="Red" Tap="GridTap"/>
</phone:PanoramaItem>
</phone:Panorama>
So the problem is next - often, when i try to swipe panorama from one item to another, i have one of buttons of first panorama item clicked. So i`m navigated to another application page. Can somebody tell me, how do i prevent this panorama control behavior ?
-----------------EDIT: EventToCommand solutions doesnt work for me.
Yes that one bugs me too and has been an issue since WP7. The solution is to use the Tap
event in this case rather than the Click
event as that doesn't give false activations in the same way. Tap
is available on any UIElement
, not just buttons.