protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { this.DefaultViewModel["Groups"] = APIMASH_StackExchangeCollection.GetGroups((String)navigationParameter);; if (!_loaded) { Invoke(); } }
void api_OnResponse(object sender, APIMASHEvent e) { StackExchangeQuestions response = (StackExchangeQuestions)e.Object; if (e.Status == APIMASHStatus.SUCCESS) { // copy data into bindable format for UI APIMASH_StackExchangeCollection.Copy(response, System.Guid.NewGuid().ToString(), "All"); Items = APIMASH_StackExchangeCollection.GetGroups("AllGroups").FirstOrDefault().Items; } }
async private void apiInvoke_OnResponse(object sender, APIMASHEvent e) { StackExchangeQuestions response = (StackExchangeQuestions)e.Object; if (e.Status == APIMASHStatus.SUCCESS) { // copy data into bindable format for UI APIMASH_StackExchangeCollection.Copy(response, System.Guid.NewGuid().ToString(), "All"); this.DefaultViewModel["AllGroups"] = APIMASH_StackExchangeCollection.GetGroups("AllGroups"); _loaded = true; } else { var md = new MessageDialog(e.Message, "Error"); md.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler((cmd) => { }))); await md.ShowAsync(); } }