I would like to create the following behaviour in a ScrollViewer
that wraps ContentControl
:
When the ContentControl
height grows , the ScrollViewer
should automatically scroll to the end. This is easy to achive by using ScrollViewer.ScrollToEnd()
.
However, if the user uses the scroll bar, the automatic scrolling shouldn't happen anymore. This is similar to what happens in VS output window for example.
The problem is to know when a scrolling has happened because of user scrolling and when it happened because the content size changed. I tried to play with the ScrollChangedEventArgs
of ScrollChangedEvent
, but couldn't get it to work.
Ideally, I do not want to handle all possible Mouse and keyboard events.