Пример #1
0
 /// <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();
     }
 }
Пример #2
0
 private void AddMessage(string message)
 {
     ConsoleMessagesField.Text += message + Environment.NewLine;
     ConsoleScroller.ScrollToEnd();
 }