/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { Search search = navigationParameter as Search; SearchViewModel svm = new SearchViewModel(); if (!string.IsNullOrWhiteSpace(search.Text)) { var results = svm.LastSearchAlbum(search.Text); // There is an issue deserializing these search results where the albums are not being // populated - I can't figure out why (yet) so I've had to put together some test data // in the meantime... this.DefaultViewModel["Items"] = svm.GetTestData(); //results.results.albummatches; } else { //ErrorMessage.Text = "Oops, you need to enter a search term."; } }