Exemple #1
0
        private void SendText(string text, SenderSide side = SenderSide.Local)
        {
            var chatText = new ChatTextViewModel()
            {
                Text         = text,
                SentDateTime = DateTime.Now,
                SenderSide   = side
            };

            ChatItems.Add(chatText);
        }
Exemple #2
0
        private void SendImage(BitmapSource image, SenderSide side = SenderSide.Local)
        {
            var chatImage = new ChatImageViewModel()
            {
                Image        = image,
                SentDateTime = DateTime.Now,
                SenderSide   = side
            };

            ChatItems.Add(chatImage);
        }
Exemple #3
0
        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);
            }));
        }