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

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.