开发者

MY web Broswer doesn't support silver light toolkit tap event and flick event

       <controls:PivotItem Header="item1">
            <Grid>
                <phone:WebBrowser IsHitTestVisible="False" Source="www.google.com">
                    <toolkit:GestureService.GestureListener>
                        <toolkit:GestureListener Tap="onTap" Flick="GestureListener_Flick" />
                    </toolkit:GestureService.GestureListener>

                </phone:WebBrowser>
            </Grid>
        </controls:PivotItem>

the code behind this

       private void onTap(object sender, GestureEventArgs e)
    {
        MessageBox.Show("tap");
       // Listbox.index = m.SelectedIndex;
        //  m.SelectedIndex = -1;
      //  App.Navigate(new Uri("/Home.xaml", UriKind.Relative));



    }
    private void GestureListener_Flick(object sender, FlickG开发者_JAVA百科estureEventArgs e)
    {
        if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
        {
            if (e.HorizontalVelocity < 0)
            {
                MessageBox.Show("right");
            }
            else
            {
                MessageBox.Show("left");
            }
        }
        else
        {
            if (e.VerticalVelocity < 0)
            {
                MessageBox.Show("up");
            }
            else
            {
                MessageBox.Show("down"); 
            }
        }
    }

but it doesn't work ... thanx in advance..


These events are not supported on the WebBrowser control. The main reason for this is probably that it's hard to distinguish whether the user is interacting with a webpage (scrolling or clicking a link) or whether you would like to capture the events on the control.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜