Content Index Search
 

SimpleScrollViewer

The scroll viewer is a content control that displays its content in a scrollable area. You can place content in a scroll viewer in Microsoft® Expression Blend™ by double-clicking the scroll viewer and then drawing an element into it. If you want to place multiple elements into the scroll viewer, you need to first add in a layout panel such as a Grid or Canvas. A scroll viewer also can display text by default; you can edit the text by selecting the scroll viewer and then modifying the Content property under Common Properties in the Properties panel. To position elements in the scroll viewer but beyond the bounds of the scroll viewer, you need to manually set the positioning properties in the Advanced property options under Layout in the Properties panel. The vertical scroll bar is visible by default. To make the horizontal scroll bar appear, set the HorizontalScrollBarVisibility property to Visible.

Artboard view: SimpleScrollViewer

The artboard view of a SimpleScrollViewer control.

Breaking down the control template

The SimpleScrollViewer control template consists of the following items:

Warning Do not rename any element whose name begins with "PART_" because these elements are referred to from the code that implements the control.

Objects view: The basic parts (template) of SimpleScrollViewer

Objects view: The basic parts (template) of a SimpleScrollViewer control.

Property triggers used

Property triggers in the control template are used to make the control react to property changes. You can click the items under Triggers in the Interaction panel to view the properties that are changed when a trigger is active. For example, in the SimpleScrollViewer template, when the IsMouseOver property becomes True, the background of the Border element changes color to the MouseOverBrush resource.

Brushes used

The SimpleScrollViewer template does not use any brush resources in the SimpleStyles.xaml resource dictionary. Instead, the Background property is template-bound to the Background property of the slider control to which the template is applied.

Best practices and design guidelines