Modifying Page Elements Using Visual States

The visibility of the search panel and itinerary list is controlled using visual states. The visual state of either control is set via an associated string property in the viewmodel. Using a visual state, rather than a Boolean property for visibility, affords greater flexibility because you can create any number of visual state values, whereas a Boolean value allows you just two. See the following viewmodel excerpt:

public const string ShowRouteSearchState = "ShowRouteSearch";public const string HideRouteSearchState = "HideRouteSearch";string routeSearchVisualState = HideRouteSearchState;public const string ShowItineraryState = "ShowItinerary";public const string HideItineraryState ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.