private void LogScrollDown(object sender, TextChangedEventArgs e) { double bottom = TbLog.VerticalOffset + TbLog.ViewportHeight; bool isBottommost = bottom >= TbLog.ExtentHeight - 10; if (isBottommost) { TbLog.ScrollToEnd(); } }
private void WithAutoScroll(Action action) { Post(() => { double bottom = TbLog.VerticalOffset + TbLog.ViewportHeight; bool isBottommost = bottom >= TbLog.ExtentHeight - 10; action(); if (isBottommost) { TbLog.ScrollToEnd(); } }); }
private void TbLog_OnTextChanged(object sender, TextChangedEventArgs e) { TbLog.CaretIndex = TbLog.Text.Length; TbLog.ScrollToEnd(); }