

The IScrollInfo interface represents the main scrolling region within a ScrollViewer or derived control. Physical scrolling is the default scroll behavior for most Panel elements. Logical scrolling is used to scroll to the next item in the logical tree. Physical scrolling is used to scroll content by a predetermined physical increment, typically by a value that is declared in pixels. The Content property defines the sole child of the ScrollViewer. You can use the ScrollChanged event to detect a change in a ScrollViewer state.Ī ScrollViewer can only have one child, typically a Panel element that can host a Children collection of elements. The ScrollViewer control responds to both mouse and keyboard commands, and defines numerous methods with which to scroll content by predetermined increments. However, you can use the ScrollViewer element by itself because it is a composite control that encapsulates ScrollBar functionality. You must build a custom object in order to use the ScrollBar element for content scrolling. The ScrollViewer control encapsulates horizontal and vertical ScrollBar elements and a content container (such as a Panel element) in order to display other visible elements in a scrollable area. There are two predefined elements that enable scrolling in WPF applications: ScrollBar and ScrollViewer. This topic introduces the ScrollViewer element and provides several usage examples. The ScrollViewer control provides a convenient way to enable scrolling of content in Windows Presentation Foundation (WPF) applications. Ideally, I would not be re-implementing all of the individual events that are captured by the Scrolled, since that could change at one point.Content within a user interface is often larger than a computer screen's display area. How can I detect a change of the scrollbar that was user initiated? However, this event is also fired when I call listView.ScrollToItem. The ListView has two Scroller elements nested, which have a changed event. I can register to the WheelEvent on the ListView itself to set a bool autoScroll to false, but then I still need to detect when the user clicks the scrollbar buttons or drags the scrollbar.

What is the best way to detect this user input on the scrollers? Now, when the user either uses the scroll wheel or drags on the scroll bar, the auto scroll should stop. If this doesn't work, it is likely due to a timing issue and we can defer the scroll via the scheduler to a later point in time. This is easy to do with the uielements ListView by simply calling listView.ScrollToItem(-1) whenever an item is added. When list items are added, the view automatically scrolls down to the last item.

I'm experimenting with a ListView that should auto scroll the same way the Unity console window does.
