Visual.VisualScrollableAreaClip Property


Gets or sets a clipped scrollable area for the Visual.

public:  property Nullable<System::Windows::Rect> VisualScrollableAreaClip {  protected public:
Nullable<System::Windows::Rect> get(); protected:
 void set(Nullable<System::Windows::Rect> value); };
public System.Windows.Rect? VisualScrollableAreaClip { protected internal get; protected set; }
member this.VisualScrollableAreaClip : Nullable<System.Windows.Rect> with get, set
Public Property VisualScrollableAreaClip As Nullable(Of Rect)

Property Value

A Rect that represents the scrollable clipping area, or null if no clipping area is assigned.


Set the VisualScrollableAreaClip property to enable accelerated scrolling when rendering in software. This is useful in remote rendering scenarios, such as running over Remote Desktop or running in a virtual machine. Set this property on the parent element whose children will be scrolled. Setting the VisualScrollableAreaClip property has no effect when rendering is hardware accelerated.

The VisualScrollableAreaClip property enables specific, advanced scenarios. The following list shows the caveats that apply when you use the VisualScrollableAreaClip property.

  • The background of the scrolled area must be opaque, or scrolling artifacts will occur.

  • The VisualScrollableAreaClip property accelerates scrolling only when WPF is rendering in software. For example, this situation occurs when the application is running over Remote Desktop or running locally in a virtual machine.

  • The scrolling behavior is unchanged when rendering in hardware. To prevent differences in scrolling behavior, you should keep the VisualScrollableAreaClip property enabled for both hardware and software.

  • Rotate and skew transforms disable accelerated scrolling. Scale transforms and horizontal or vertical translations above the scrolled region work correctly and do not disable scrolling acceleration.

  • Changing the subtree or triggering parts of the scrollable area to redraw via animation behave as expected, but lose the benefit of accelerated scrolling for the redrawn area. Any animation that invalidates the scrolled area during the same frame in which scrolling occurs eliminates the benefit of this optimization.

  • The VisualScrollableAreaClip rectangle snaps inward to pixels. Therefore, the snapped size of the scrolling rectangle is always less than or equal to the size you have set.

  • Offsets snap downward. This means that the difference of the previous snapped offset and current snapped offset is always an integer number of pixels.

  • Hit tests can be off by up to a pixel.

  • Layout rounding should be turned on, because it ensures that the edges of scrollable areas and the boundary window client area are snapped to pixel boundaries, resulting in correct alignment.

  • Scrolling acceleration does not work on layered windows. This means windows in which AllowTransparency == true, window.windowstyle == none, and so on.

  • Scrolling acceleration does not occur during full-window rendering.

  • Scrolling acceleration does not work when the window straddles two monitors.

  • Scrolling acceleration does not work in the presence of intermediate render targets in the parent chain of the scrolled element. The following list shows some of these intermediate render targets.

    • Clips

    • Effects

    • DrawingBrushes

    • VisualBrushes

    • OpacityMasks

    • Opacity

  • Only one accelerated scroll can happen per frame. There can be multiple accelerated scroll areas, but only one of them can perform an accelerated scroll during a frame. Which area is scrolled is indeterminate.

  • Scrolling acceleration supports content above the scrolling region (in z-order) that is not scrolled with the rest of the content. The system calculates all necessary dirty regions and completes the accelerated scroll, but it sends several additional bitmaps over the wire to move the unintentionally scrolled portion back to its correct position on screen.

Applies to