Map inside Panorama moves the panorama when pannin

2020-04-11 11:39发布

Well basically, I have this bing map control inside my Panorama view, when I pan left or right, the panorama changes columns. Is there a way to avoid this?

Video of behavior

Thanks!

3条回答
劳资没心,怎么记你
2楼-- · 2020-04-11 12:08

Put the map within your own control or make a control that inherits from the map (if possible).

Then in the Control's code-behind file, put this. It worked for me:

    protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
    {
        e.Handled = true;
    }

    protected override void OnManipulationDelta(ManipulationDeltaEventArgs e)
    {
        e.Handled = true;
    }

    protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
    {
        e.Handled = true;
    }

    private void Control_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        e.Handled = true;
    }

    private void Control_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    {
        e.Handled = true;
    }
查看更多
冷血范
3楼-- · 2020-04-11 12:09

Try setting IsEnabled=False on the Map will do the trick Provided you don't need to manipulate that map you show in the Panorama

查看更多
手持菜刀,她持情操
4楼-- · 2020-04-11 12:27

It's advisable to not use the map in a panorama for this reason. If you are able to lock the map, then Jobi's suggestion should work for you.

This from Jeff Wilcox for reference:

- "Using a map control inside a Panorama or Pivot is not recommended for a number of UX and technical reasons. Navigate to a subpage."

查看更多
登录 后发表回答