private void AsyncLoadItems() { //Task.Run(async () => //{ // var result = await countServices.GetAll(); // if (result != null) // { // Device.BeginInvokeOnMainThread(() => // { // Items = new ObservableCollection<CountPlan>(result); // }); // } //}); Task.Run(async() => { var result = await countServices.GetAll(); if (result != null) { Device.BeginInvokeOnMainThread(() => { Items = new ObservableCollection <CountPlan>(result); }); } }); }
private async void LoadItems() { var result = await countServices.GetAll(); if (result != null) { _items = new ObservableCollection <CountPlan>(result); } }
public async void LoadData() { CountServices services = new CountServices(); var result = await services.GetAll(); List <Test> list = new List <Test>(); list.Add(new Test() { Id = 1, Value1 = "uno", Value2 = "Dos" }); list.Add(new Test() { Id = 2, Value1 = "tres", Value2 = "cuatro" }); }