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