Carlo
Carlo

Reputation: 25959

Map inside Panorama moves the panorama when panning map

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!

Upvotes: 3

Views: 1242

Answers (3)

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;
    }

Upvotes: 0

Mick N
Mick N

Reputation: 14882

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."

Upvotes: 3

Jobi Joy
Jobi Joy

Reputation: 50038

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

Upvotes: 0

Related Questions