Murali R

Murali R

  • NA
  • 41
  • 7.5k

How to disable map from being scrolled in windows phone8.1?

Nov 3 2015 2:36 AM

Hi

In a button click event ,want to disable the map being scrolled/dragged/Zoomed.

I tried MyMap.IsHitTestVisible = false; and MyMap.IsEnabled = false;

But both didn't work.How to disable the map being scrolled/dragged/Zoomed.

My Code:

<Grid x:Name="MainGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid x:Name="grdMyMap" Grid.Column="0" >
<map:MapControl x:Name="MyMap" MapServiceToken="2wKJ49upUP13N8_j7BRNeQ"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
</map:MapControl>
</Grid>
<Grid x:Name="buttonpanel" Visibility="Visible" VerticalAlignment="Bottom" Background="Black" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="399*"/>
</Grid.ColumnDefinitions>

<Button x:Name="Stop" Content="Stop Scrolling" Grid.Column="1" Foreground="Violet" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="1,0,0,0" Margin="0,0,0,0" Click="Stop_Click" />
</Grid>
</Grid>

Code Behind:

private void Stop_Click(object sender, RoutedEventArgs e)
{

grdMyMap.IsHitTestVisible = false;
}