How to Adjust the Map Control for Low Light Conditions in Windows Phone 8 App?

There are times when the developer need to adjust the map control to suit the different conditions like day time or night time access. To achieve this, the Map Control in Windows Phone 8 exposes the ColorMode property which can be used to toggle between light and dark color mode.

How to Adjust the Map Control for Low Light Conditions in Windows Phone 8 App?

The ColorMode property takes one of the values

  • Microsoft.Phone.Maps.Controls.MapColorMode.Dark
  • Microsoft.Phone.Maps.Controls.MapColorMode.Light
How to Adjust the Map Control for Low Light Conditions in Windows Phone 8 App?

How to Adjust the Map Control for Low Light Conditions in Windows Phone 8 App?

Sample Code Snippet for setting the Color Mode for Map Control

XAML (MapControl)

<maps:Map x:Name="Map1" ColorMode="Dark" HorizontalAlignment="Left" Height="563" Margin="0,44,0,0" VerticalAlignment="Top" Width="446" Loaded="Map1_Loaded" />

C#

Map1.ColorMode = Microsoft.Phone.Maps.Controls.MapColorMode.Dark;

Leave a Reply