This is a migrated thread and some comments may be shown as answers.

Double tap zoom does not work

3 Answers 103 Views
PanAndZoomImage
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jaakko
Top achievements
Rank 1
Jaakko asked on 06 Mar 2013, 08:44 AM
Hi!

I'm implementing a WP7.1 app that has a image preview screen that needs to be zoomable and pannable.
The PanAndZoomImage + busy indicator is the sole content of a portrait PhoneApplicationPage. The page title and app bar need to remain visible while zooming.

Now, the xaml pasted below is otherwise good for the purpose, but double tapping the image (after loading it, when zoom=1,1) does nothing. If I zoom in via pinch, double tap will return to normal zoom though. If I create a handler for Tap event, I can get the image to zoom, but double tap will return the image to default zoom. Also, if I add a handler for DoubleTap event (like in http://www.telerik.com/community/forums/windows-phone/slideview/selected-index.aspx ), anything I do related to zoom (e.g. set zoom to 2,2) seems to be overridden (by the default DoubleTap handling, perhaps).

Any hints on how to
a) enable the default double tap zoom in this case, or
b) override the default doubletap handler completely and implement custom zoom logic?

I'm using the WP7 Q3/2012 release.

 <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>   

        <Grid x:Name="ContentPanel" Grid.Row="1" Grid.Column="0"
              Margin="-12,-12,-12,0">

            <slideView:PanAndZoomImage x:Name="PreviewPhoto" 
                                       ZoomMode="Free"
                                       MaximumZoom="4,4"
                                       VerticalAlignment="Top"
                                       HorizontalAlignment="Center"/>

            <ProgressBar x:Name="BusyIndicator" 
                     Height="71"
                     Width="360"
                     VerticalAlignment="Center" 
                     HorizontalAlignment="Center" 
                     Visibility="Collapsed"/>
        </Grid>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" 
                    Margin="0,0,0,0"
                    Background="Black">
            <TextBlock x:Name="ApplicationTitle" Text="APP" 
                       Style="{StaticResource PhoneTextNormalStyle}"
                       Margin="21,17,0,0"/>
            <TextBlock x:Name="PageTitle" Text="preview" 
                       Margin="21,-7,0,8" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
    </Grid>

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 07 Mar 2013, 08:58 AM
Hi Jaako,

Thanks for writing.
The behavior you are experiencing is related to the fact that your PanAndZoomImage control is allowed determine its own size. You need to stretch the control over your allowed space in order to be able to double tap to zoom.

Greetings,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Jonathan
Top achievements
Rank 1
answered on 05 Feb 2014, 03:17 AM
Victor,

Could you let me know what you mean by stretching the control over the allowed space?  I am having the same problem and do not know what to do.  Could you update the code listed above to show how to stretch the control over the entire screen?
0
Todor
Telerik team
answered on 10 Feb 2014, 08:22 AM
Hi Jonathan,

I have attached a sample with slight modifications of the code from the previous post.

Let us know if you need further assistance.

Regards,
Todor
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Tags
PanAndZoomImage
Asked by
Jaakko
Top achievements
Rank 1
Answers by
Victor
Telerik team
Jonathan
Top achievements
Rank 1
Todor
Telerik team
Share this question
or