ScrollViewer

Scrollable viewport with keyboard and mouse wheel navigation.

Overview

The ScrollViewer control extends ContentControl to wrap any single child element in a scrollable viewport. When the content is taller (or wider) than the available space, ScrollViewer renders the child to an intermediate buffer and blits the visible region to the screen. Scroll indicators on the viewport edges show the current position.

<ScrollViewer VerticalScrollBarVisibility="Auto">
    <StackPanel Orientation="Vertical">
        <TextBlock Text="Line 1" StackPanel.SizeMode="Fixed" StackPanel.FixedSize="1" />
        <TextBlock Text="Line 2" StackPanel.SizeMode="Fixed" StackPanel.FixedSize="1" />
        <!-- ... many more lines ... -->
    </StackPanel>
</ScrollViewer>

Key Concepts