ScrollContentPresenter.CanContentScroll Property

Indicates whether the content, if it supports IScrollInfo, should be allowed to control scrolling

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public bool CanContentScroll { get; set; }
/** @property */
public boolean get_CanContentScroll ()

/** @property */
public void set_CanContentScroll (boolean value)

public function get CanContentScroll () : boolean

public function set CanContentScroll (value : boolean)

<object CanContentScroll="bool" .../>

Property Value

true if the content is allowed to scroll; otherwise, false. A false value indicates that the ScrollContentPresenter acts as the scrolling client. This property has no default value.

The following example demonstrates how to use the CanContentScroll property in Extensible Application Markup Language (XAML).

     <Style TargetType="{x:Type ScrollViewer}">
       <Setter Property="OverridesDefaultStyle" Value="True" />
       <Setter Property="Template">
           <ControlTemplate TargetType="{x:Type ScrollViewer}">
                 <ColumnDefinition Width="Auto"/>
                 <ColumnDefinition Width="*"/>
                 <RowDefinition Height="*"/>
                 <RowDefinition Height="Auto"/>
               <Border Grid.Row="0" Grid.Column="1">
                 <ScrollContentPresenter CanContentScroll="True" Content="{TemplateBinding ScrollViewer.Content}" />
               <ScrollBar Orientation="Vertical" Grid.Row="0" Grid.Column="0" Minimum="0" Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}" Value="{TemplateBinding ScrollViewer.VerticalOffset}" ViewportSize="{TemplateBinding ScrollViewer.ViewportHeight}" Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}" 
               <ScrollBar Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="{TemplateBinding ScrollViewer.ScrollableWidth}" Value="{TemplateBinding ScrollViewer.HorizontalOffset}" ViewportSize="{TemplateBinding ScrollViewer.ViewportWidth}" Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ScrollViewer.ComputedHorizontalScrollBarVisibility}"/>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions