O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adjusting for Low Light Conditions

The Map class’s ColorMode property allows you to change the tonal palette of the map from a light palette, suitable for daytime viewing, to a dark pallet, suitable for night time viewing or low light conditions.

The dark mode/light mode menu item in the MapView page toggles the Map control’s ColorMode property from light to dark. The Map control’s ColorMode property is bound to the MapViewModel’s MapColorMode, as shown:

<m:Map x:Name="map"    ...    ColorMode="{Binding MapColorMode, Mode=TwoWay}"    ...</m:Map>

An AppBarMenuItem is bound to the viewmodel’s ToggleColorModeCommand, like so:

<u:AppBarMenuItem    x:Name="toggleColorModeMenuItem"    Command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required