public FriendList() { InitializeComponent(); ConversationViewMessage msg = new ConversationViewMessage("Hello! Than Thanh An", DateTime.Now, ConversationViewMessageType.Outgoing); messageOnChatView.Add(msg); Cons_ChatView.DataContext = messageOnChatView; }
private void OnSendingMessage(object sender, ConversationViewMessageEventArgs e) { if (string.IsNullOrEmpty((e.Message as ConversationViewMessage).Text)) { return; } Deployment.Current.Dispatcher.BeginInvoke(() => { ConversationViewMessage originalMessage = e.Message as ConversationViewMessage; MessagesViewModel viewModel = this.DataContext as MessagesViewModel; CustomMessage customMessage = new CustomMessage(originalMessage.Text, originalMessage.TimeStamp, originalMessage.Type, viewModel.You.PersonId); viewModel.Messages.Add(customMessage); App.iXFacebook.SendMessage(originalMessage.Text, Global.GSelectedFriendId); }); }