private void Button_Click(object sender, RoutedEventArgs e) { string partisipants = Account.Id + " " + (Interlocutor.Tag as AccountDTO).Id; string partisipantsRes = partisipants.Split().Min() + " " + partisipants.Split().Max(); MessageDTO message = new MessageDTO { Content = tbMessage.Text, DeliverId = Account.Id, Data = DateTime.Now }; messengerClient.AddMessage(message.Content, message.Data, message.DeliverId.Value); messengerClient.AddChat(partisipantsRes, message, (Interlocutor.Tag as AccountDTO).Name + "&" + Account.Name, null); tbMessage.Text = ""; }