ScrollViewer.ChangeView(IReference(Double), IReference(Double), IReference(Single), Boolean) method

Applies to Windows and Windows Phone

Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor, and optionally disables scrolling animation.

Syntax


public bool ChangeView(
  Nullable<double> horizontalOffset, 
  Nullable<double> verticalOffset, 
  Nullable<float> zoomFactor, 
  bool disableAnimation
)

Parameters

horizontalOffset

Type: IReference<Double> [C++] | System.Nullable<Double> [.NET]

A value between 0 and ScrollableWidth that specifies the distance the content should be scrolled horizontally.

verticalOffset

Type: IReference<Double> [C++] | System.Nullable<Double> [.NET]

A value between 0 and ScrollableHeight that specifies the distance the content should be scrolled vertically.

zoomFactor

Type: IReference<Single> [C++] | System.Nullable<Single> [.NET]

A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor.

disableAnimation

Type: System.Boolean [.NET] | Platform::Boolean [C++]

true to disable zoom/pan animations while changing the view; otherwise, false. The default is false.

Return value

Type: System.Boolean [.NET] | Platform::Boolean [C++]

true if the view is changed; otherwise, false.

Remarks

You can set parameter values to null to use this method to scroll only horizontally, only vertically, or to only change the zoom factor.

Examples

This code results in a ScrollViewer named myScrollViewer being scrolled to a horizontal offset of 2 without animation.


bool flag = myScrollViewer.ChangeView(2, null, null, true); 

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

ScrollViewer
ChangeView(IReference(Double), IReference(Double), IReference(Single))

 

 

Show:
© 2014 Microsoft