public async void GetRecipes() { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { using (var client = new WebService.ServerSoapClient()) { var response = await client.GetRecipesAsync(); response.Body.GetRecipesResult.ToList().ForEach(x => RecipesGridView.Items.Add( new GridItemRecipe( new Uri("http://qnimate.com/wp-content/uploads/2014/03/images2.jpg"), x.Name) ) ); response.Body.GetRecipesResult.ToList().ForEach(x => recipes.Add(x)); } }); }
public async System.Threading.Tasks.Task <List <GridItemRecipe> > getAsync() { List <GridItemRecipe> x = new List <GridItemRecipe>(); using (var client = new WebService.ServerSoapClient()) { var response = await client.GetRecipesAsync(); //response.Body.GetRecipesResult.ToList().ForEach(x => // RecipesGridView.Items.Add( // new GridItemRecipe( // new Uri("http://qnimate.com/wp-content/uploads/2014/03/images2.jpg"), x.Name) // ) // ); response.Body.GetRecipesResult.ToList().ForEach(r => ItemRecipes.Add( new GridItemRecipe(new Uri("http://qnimate.com/wp-content/uploads/2014/03/images2.jpg"), r.Name) )); } return(x); }