async private void apiInvoke_OnResponseInTheaters(object sender, Event e) { var response = (RottenTomatoesMovies)e.Object; if (e.Status == Status.SUCCESS) { RottenTomatoesCollection.Copy(response, System.Guid.NewGuid().ToString(), "In Theaters"); this.DefaultViewModel["AllGroups"] = 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(); } }
async void apiInvokeReviews_OnResponse(object sender, Event e) { var cc = (ReviewControl)ReviewPopup.Child; var response = (MovieReviews)e.Object; if ((e.Status == Status.SUCCESS) && (response.Reviews.Length > 0)) { var mg = new MovieReviewGroup(); mg.Copy(response); cc.MovieReviews = mg; cc.Initialize(); ReviewPopup.IsOpen = true; } else { if (response.Reviews.Length <= 0) e.Message = "There are no previews"; var md = new MessageDialog(e.Message, "Error"); bool? result = null; md.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler((cmd) => result = true))); await md.ShowAsync(); } }