private void Refresh() { IsRefreshing = true; Chats.Clear(); LoadChats(); IsRefreshing = false; }
public void Stop() { StopAllChats(); ChatChannels.Clear(); Chats.Clear(); Chats = null; if (timerUpdateDatabase != null) { timerUpdateDatabase.Change(Timeout.Infinite, Timeout.Infinite); } }
private async void RetrieveMessage() { var chats = await remoteService.RetrieveMessage(); Chats.Clear(); foreach (var item in chats) { if ((item.SenderId == Settings.KeySettings && item.ReceiverId == Id) || (item.SenderId == Id && item.ReceiverId == Settings.KeySettings)) { Chats.Add(item); } } }
public async Task ExecuteLoadChatsCommand() { IsBusy = true; try { Chats.Clear(); var chats = await DataStore.GetChats(Local.LocalUser.Id); foreach (var chat in chats) { Chats.Add(new ChatVM(chat, Local.LocalUser.Id)); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
private void Initialize() { if (_dataService == null || Chats == null) { return; } if (Chats.Count > 0) { Chats.Clear(); } foreach (var chat in _dataService.Chats.ToList()) { if (chat is IChatUserList) { Chats.Add(new ChatUserListViewModel() { Chat = chat, UserList = (chat as IChatUserList).ChatUsers, }); } } }