Пример #1
0
        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;
            }
        }
Пример #2
0
        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();
            }
        }