Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ScrollContentPresenter Class

Updated: November 2007

Displays the content of a ScrollViewer control.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/xaml/presentation

Visual Basic (Declaration)
Public NotInheritable Class ScrollContentPresenter _
    Inherits ContentPresenter _
    Implements IScrollInfo
Visual Basic (Usage)
Dim instance As ScrollContentPresenter
C#
public sealed class ScrollContentPresenter : ContentPresenter, 
    IScrollInfo
Visual C++
public ref class ScrollContentPresenter sealed : public ContentPresenter, 
    IScrollInfo
J#
public final class ScrollContentPresenter extends ContentPresenter implements IScrollInfo
JScript
public final class ScrollContentPresenter extends ContentPresenter implements IScrollInfo
XAML Object Element Usage
<ScrollContentPresenter .../>

The ScrollContentPresenter class provides support for styling the various components of a ScrollViewer control. For information about the scrolling region inside a ScrollViewer, see IScrollInfo.

The following example demonstrates how to use a ScrollContentPresenter to style the content of a ScrollViewer control.

XAML
<Style TargetType="{x:Type ScrollViewer}">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate>
        <Grid>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
          </Grid.RowDefinitions>
          <Border Grid.Row="0" Grid.Column="1">
            <ScrollContentPresenter Content="{TemplateBinding ScrollViewer.Content}" />
          </Border>
          <RepeatButton Grid.Column="0" Style="{DynamicResource ScrollBar_LineButton}" Command="ScrollBar.LineLeftCommand" Content="M 0 3.5 L 4 0 L 4 7 Z" />
          <RepeatButton Grid.Column="2" Style="{DynamicResource ScrollBar_LineButton}" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 3.5 L 0 7 Z" />
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

System..::.Object
  System.Windows.Threading..::.DispatcherObject
    System.Windows..::.DependencyObject
      System.Windows.Media..::.Visual
        System.Windows..::.UIElement
          System.Windows..::.FrameworkElement
            System.Windows.Controls..::.ContentPresenter
              System.Windows.Controls..::.ScrollContentPresenter
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker