private void btnSendMessage_Click(object sender, RoutedEventArgs e) { if (lvContacts.SelectedItem != null) //Nur wenn ein Kontakt ausgewählt ist { cClient.SendMessage(((UserControlContactItem)lvContacts.SelectedItem).Email, txtMessage.Text); UserControlMessageSent messagesent = new UserControlMessageSent(txtMessage.Text, DateTime.Now.ToString()); splChat.Children.Add(messagesent); // Nach unten scrollen Application.Current.Dispatcher.Invoke((Action) delegate { chatViewScroller.ScrollToBottom(); }); } }