private void SendMessage_Click(object sender, EventArgs e) { messages.Add(new Message { Content = ComposeMessage.Text }); ComposeMessage.Text = String.Empty; MainScroller.UpdateLayout(); MainScroller.ScrollToVerticalOffset(MainScroller.ScrollableHeight); }
private void ComposeMessage_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { messages.Add(new Message { Content = ComposeMessage.Text }); ComposeMessage.Text = String.Empty; MainScroller.UpdateLayout(); MainScroller.ScrollToVerticalOffset(MainScroller.ScrollableHeight); } }