WP7 control and WebBrowser control

I have a Pivot that contains a WebBrowser control that actually takes up the whole page (e.g. from the Pivot header).

I would like to figure out how to make the WebBrowser control allow the user to scroll left / right to activate the Pivot element. It currently just controls the left / right WebBrowser control

Can this be done?

thank

+2
source share
4 answers

Pivot - - http://mine.tuxfamily.org/?p=111 - - https://stackoverflow.com/search?q=mine.tuxfamily.org

, , , :

  • , Touch PivotItem

, - html ( ), HitTesting -.

0

, swipes , , : // WebBrowser.

, 7.0:

  • WebBrowser TileHost, /.
  • TileHost , .
  • TileHost ( ), .Net, - ( ), , , / , WebBrowserInterop .

, 7,5, (, 7.1 , ), , MS WebBrowser. , , / .Net-. PanZoomContainer VisualTree WebBrowser. WebBrowserInterop . WebBrowserInterop PanZoomContainer ManipulationEvents, . , / , , , "ZoomAndScroll" "ShowSIP", PanZoomContainer. ? , PanZoomC.

, /?

PanZoomContainer, Mani- . TileHost . WebBrowser VisualTree , , PanZoomContainer TileHost (). , :

WebBrowser
  PanZoom
    ContentPresenter
      Border/Name="border"   <- you want this one
        TileHost

, . , PanZoomContainer Mani-Events, !

VisualTreeHelper, , FrameworkElement.Name == "border". , TileHost, "", 99% . , ContentPresenter, , controltemplate ( Loaded/LayoutUpdated).

, Mani-Event: , . PanZoom - xaml/silverlight/.net/etc, e.Handled = true:) , ie. , Delta Completed Translation.Y < > 0. , / - X == 0 & Y == 0.

.

- Start/Delta/Stop .

, / . , " , ", y == 0, e.handled = true ". ? ? !

, " ", " ". , , :

. , // , X- ZERO. , . , , .

, == 0, . . , offaxis . , , , , .

:

, e.Handled = true. GONE. . Deased. , WebBrowser SKIP, , , (Pivot) ..... . GONE. TileHost/PanZoomC , . , ??

:

  • , , . , , e.Handled = true , .. .
  • - , , : GestureListener/GestureService Silverlight Toolkit. , -, - e.Handled = true, . , , .

.. , , .

+4

WP7 Pivot, - Preview * Pivot, ?

0

PivotControl x: name WebBrowserControl x: name .

WebBrowserControl pivot i.e. Pivot Index 1, 2 1 .

public static void SwipteLeftRight(Microsoft.Phone.Controls.Pivot pivotControl, Microsoft.Phone.Controls.WebBrowser webBrowserControl)        
        {
            var gesListener = GestureService.GetGestureListener(webBrowserControl);
            gesListener.Flick += ((sen, args) =>
            {
                if (args.Direction == System.Windows.Controls.Orientation.Horizontal)
                {
                    if (args.HorizontalVelocity < 0)
                    {

                        if (((Microsoft.Phone.Controls.PivotItem)(pivotControl.SelectedItem)).Header.ToString().Trim() == "Pivot Item name")
                        {
                            pivotControl.SelectedIndex = 2; //Next Pivot item
                        }
                    }
                    else if (args.HorizontalVelocity > 0)
                    {

                        if ((Microsoft.Phone.Controls.PivotItem)(pivotControl.SelectedItem)).Header.ToString().Trim() == "Pivot Item name")
                        {
                            pivotControl.SelectedIndex = 0; // Previous Pivot Item
                        }
                    }
                }
            });
        }

.

0

All Articles