/// <summary> /// Scrolls to the bottom of the console window on update if already scrolled to the bottom. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The scroll changed event arguments.</param> private void ConsoleScroller_ScrollChanged(object sender, System.Windows.Controls.ScrollChangedEventArgs e) { if (ConsoleScroller.VerticalOffset == ConsoleScroller.ScrollableHeight && e.ExtentHeightChange != 0) { ConsoleScroller.ScrollToEnd(); } }
private void AddMessage(string message) { ConsoleMessagesField.Text += message + Environment.NewLine; ConsoleScroller.ScrollToEnd(); }