Пример #1
0
		private void OnMessageUpdated(ChatMessage message)
		{
			
		}
Пример #2
0
		private void OnMessageDeleted(ChatMessage message)
		{
			
		}
Пример #3
0
		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();
				}
			});
		}