protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { var movieGroups = APIMASH_RottenTomatoesCollection.GetGroups((String)navigationParameter); this.DefaultViewModel["Groups"] = movieGroups; if (!_loaded) { Invoke(); } }
async private void apiInvoke_OnResponseInTheaters(object sender, APIMASHEvent e) { var response = (RottenTomatoesMovies)e.Object; if (e.Status == APIMASHStatus.SUCCESS) { // copy data into bindable format for UI APIMASH_RottenTomatoesCollection.Copy(response, System.Guid.NewGuid().ToString(), "In Theaters"); //APIMASH_RottenTomatoesCollection.Copy(response, System.Guid.NewGuid().ToString(), "DVD Top Rentals"); this.DefaultViewModel["AllGroups"] = APIMASH_RottenTomatoesCollection.GetGroups("AllGroups"); _loaded = true; } else { var md = new MessageDialog(e.Message, "Error"); bool?result = null; md.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler((cmd) => result = true))); await md.ShowAsync(); } }