public override async Task LoadData() { PreLoadData.Execute(null); var result = await ApiHelper.Get <List <Sim> >(ApiUrl, true); if (result.IsSuccess) { var list = (List <Sim>)result.Content; var count = list.Count; if (count > 0) { for (int i = 0; i < count; i++) { var item = list[i]; Data.Add(new SimViewModel(item)); } } else { OutOfData = true; } } else { Data.Clear(); Page = 1; } OnPropertyChanged(nameof(IsEmptyList)); }
public override async Task LoadData() { PreLoadData.Execute(null); var result = await ApiHelper.Get <List <ChatConversation> >(ApiUrl, true); if (result.IsSuccess) { var list = (List <ChatConversation>)result.Content; var count = list.Count; if (count > 0) { for (int i = 0; i < count; i++) { var item = list[i]; var chatConversation = new ChatConversationModel { Id = item.Id, LatestContent = item.LatestContent, CreatedOn = item.CreatedOn, ModifiedOn = item.ModifiedOn, }; if (item.User1.Id == UserLogged.Id) { chatConversation.Receiver = item.User2; } else { chatConversation.Receiver = item.User1; } Data.Add(chatConversation); } } else { OutOfData = true; } } else { Data.Clear(); Page = 1; } OnPropertyChanged(nameof(IsEmptyList)); }