locked
Windows Store Apps - WebView inside FlipView

    Question

  • Dears,

    I am putting WebView inside a FlipView and binding to the ModelView, all is good instead of when swiping, because the WebView consumes any touch event, so the touch event can not be routed to the FlipView

    Do you have any idea how to solve this problem

    Thanx
    Monday, November 10, 2014 6:13 PM

Answers

  • Is this a Windows Store app or a Windows Phone Store app?

    The behaviour you describe is documented for Windows Phone Store apps. It is not generally expected for a Windows Store app, although that somewhat depends on the contents of the WebView. See the remarks in the WebView documentation at http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.controls.webview.aspx .

    The following works fine for me on a Windows machine and allows me to flip through the web pages by touch. It won't work on Windows Phone.

           <FlipView>
               <FlipViewItem>
                    <WebView Source="http://blogs.msdn.com/b/wsdevsol" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://www.microsoft.com" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://dev.windows.com" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://www.example.com" />
                </FlipViewItem>
            </FlipView>

    The only solution is not to use this combination. One possibility is to use a WebViewBrush if you don't need the WebView to be interactive.
    Thursday, November 13, 2014 2:43 AM
    Owner

All replies

  • Hi Bilal,

    I don't know your exact scenario but could you simply do not cover the entire FilpView area with WebView? Leave some FlipView space for users to swipe the FlipView pages.

    Leszek


    My Apps


    • Edited by ata6502 Monday, November 10, 2014 6:35 PM
    Monday, November 10, 2014 6:35 PM
  • Hi Bilal,

    WebView eats all your gesture, FlipView cannot get any gesture, that is expected.

    Could you simply enable the FlipView navigation buttons and ask your user tap that to move forwards or backwards. Or follow the suggestion by Leszek.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, November 13, 2014 2:16 AM
    Moderator
  • Is this a Windows Store app or a Windows Phone Store app?

    The behaviour you describe is documented for Windows Phone Store apps. It is not generally expected for a Windows Store app, although that somewhat depends on the contents of the WebView. See the remarks in the WebView documentation at http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.controls.webview.aspx .

    The following works fine for me on a Windows machine and allows me to flip through the web pages by touch. It won't work on Windows Phone.

           <FlipView>
               <FlipViewItem>
                    <WebView Source="http://blogs.msdn.com/b/wsdevsol" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://www.microsoft.com" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://dev.windows.com" />
                </FlipViewItem>
                <FlipViewItem>
                    <WebView Source="http://www.example.com" />
                </FlipViewItem>
            </FlipView>

    The only solution is not to use this combination. One possibility is to use a WebViewBrush if you don't need the WebView to be interactive.
    Thursday, November 13, 2014 2:43 AM
    Owner