Пример #1
0
        private void LogScrollDown(object sender, TextChangedEventArgs e)
        {
            double bottom       = TbLog.VerticalOffset + TbLog.ViewportHeight;
            bool   isBottommost = bottom >= TbLog.ExtentHeight - 10;

            if (isBottommost)
            {
                TbLog.ScrollToEnd();
            }
        }
Пример #2
0
 private void WithAutoScroll(Action action)
 {
     Post(() => {
         double bottom     = TbLog.VerticalOffset + TbLog.ViewportHeight;
         bool isBottommost = bottom >= TbLog.ExtentHeight - 10;
         action();
         if (isBottommost)
         {
             TbLog.ScrollToEnd();
         }
     });
 }
Пример #3
0
 private void TbLog_OnTextChanged(object sender, TextChangedEventArgs e)
 {
     TbLog.CaretIndex = TbLog.Text.Length;
     TbLog.ScrollToEnd();
 }