void reorderContacts() { App.Current.Dispatcher.Invoke(() => { if (ActiveConversations.Count > 0) { ActiveConversations = ActiveConversations.OrderByDescending(c => c.Contact.Online).ThenByDescending(c => c.LastMessageDate).ToList(); OnPropertyChanged(nameof(ActiveConversations)); } }); }
private void _client_OnConversationHistoryReceived(object sender, List <Core.ProtoJson.Schema.ConversationState> e) { // associate contact list and last active conversation // only 1 to 1 conversation supported if (ActiveConversations == null) { ActiveConversations = new List <ConversationViewModel>(); } foreach (Core.ProtoJson.Schema.ConversationState conversation in e) { ActiveConversations.Add(new ConversationViewModel(new Conversation(conversation))); } reorderContacts(); }
private void _client_OnNewConversationCreated(object sender, Core.ProtoJson.Schema.ConversationState e) { ActiveConversations.Add(new ConversationViewModel(new Conversation(e))); reorderContacts(); }