private void OnMessageUpdated(ChatMessage message) { }
private void OnMessageDeleted(ChatMessage message) { }
private void OnMessageCreated(ChatMessage message) { var item = _chatRooms.FirstOrDefault(r => r.Room.Id == message.RoomId); if (item == null) return; item.Messages.Add(message); GuiDispatcher.GlobalDispatcher.AddAction(() => { if (item != SelectedRoom) { item.HasNewItems = true; UnreadMessages.SafeInvoke(true); } else { var scroll = Messages.FindVisualChild<ScrollViewer>(); if (scroll != null) scroll.ScrollToEnd(); } }); }