New! GraphQL.NET Cookbook by Senthil Kumar Balu

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;
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.