private void SendText(string text, SenderSide side = SenderSide.Local) { var chatText = new ChatTextViewModel() { Text = text, SentDateTime = DateTime.Now, SenderSide = side }; ChatItems.Add(chatText); }
private void SendImage(BitmapSource image, SenderSide side = SenderSide.Local) { var chatImage = new ChatImageViewModel() { Image = image, SentDateTime = DateTime.Now, SenderSide = side }; ChatItems.Add(chatImage); }
public void AddChatText(string nickname, Brush nicknameColor, Brush chatColor, string chatBody) { System.Windows.Application.Current.Dispatcher.BeginInvoke(new ThreadStart(() => { ChatItem newItem = new ChatItem(); newItem.Nickname = nickname; newItem.NicknameColor = nicknameColor; newItem.ChatTextColor = chatColor; newItem.ChatText = chatBody; ChatItems.Add(newItem); })); }