ScrollViewer.ChangeView Method

Definition

Overloads

ChangeView(Nullable<Double>, Nullable<Double>, Nullable<Single>)

Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor.

ChangeView(Nullable<Double>, Nullable<Double>, Nullable<Single>, Boolean)

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

ChangeView(Nullable<Double>, Nullable<Double>, Nullable<Single>)

Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor.

public:
 virtual bool ChangeView(IReference<double> ^ horizontalOffset, IReference<double> ^ verticalOffset, IReference<float> ^ zoomFactor) = ChangeView;
/// [Windows.Foundation.Metadata.Overload("ChangeView")]
bool ChangeView(IReference<double> const & horizontalOffset, IReference<double> const & verticalOffset, IReference<float> const & zoomFactor);
[Windows.Foundation.Metadata.Overload("ChangeView")]
public bool ChangeView(System.Nullable<double> horizontalOffset, System.Nullable<double> verticalOffset, System.Nullable<float> zoomFactor);
Public Function ChangeView (horizontalOffset As Nullable(Of Double), verticalOffset As Nullable(Of Double), zoomFactor As Nullable(Of Single)) As Boolean

Parameters

horizontalOffset
Nullable<Double>

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

verticalOffset
Nullable<Double>

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

zoomFactor
Nullable<Single>

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

Returns

Boolean

true if the view is changed; otherwise, false.

Attributes
Windows.Foundation.Metadata.OverloadAttribute

Examples

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

bool flag = myScrollViewer.ChangeView(2, null, null); 
bool flag{ myScrollViewer.ChangeView(Windows::Foundation::IReference<double>{2.f}, nullptr, nullptr) };

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.

See also

Applies to

ChangeView(Nullable<Double>, Nullable<Double>, Nullable<Single>, Boolean)

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

public:
 virtual bool ChangeView(IReference<double> ^ horizontalOffset, IReference<double> ^ verticalOffset, IReference<float> ^ zoomFactor, bool disableAnimation) = ChangeView;
/// [Windows.Foundation.Metadata.Overload("ChangeViewWithOptionalAnimation")]
bool ChangeView(IReference<double> const & horizontalOffset, IReference<double> const & verticalOffset, IReference<float> const & zoomFactor, bool disableAnimation);
[Windows.Foundation.Metadata.Overload("ChangeViewWithOptionalAnimation")]
public bool ChangeView(System.Nullable<double> horizontalOffset, System.Nullable<double> verticalOffset, System.Nullable<float> zoomFactor, bool disableAnimation);
Public Function ChangeView (horizontalOffset As Nullable(Of Double), verticalOffset As Nullable(Of Double), zoomFactor As Nullable(Of Single), disableAnimation As Boolean) As Boolean

Parameters

horizontalOffset
Nullable<Double>

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

verticalOffset
Nullable<Double>

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

zoomFactor
Nullable<Single>

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

disableAnimation
Boolean

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

Returns

Boolean

true if the view is changed; otherwise, false.

Attributes
Windows.Foundation.Metadata.OverloadAttribute

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); 
bool flag{ myScrollViewer.ChangeView(Windows::Foundation::IReference<double>{2.f}, nullptr, nullptr, true) };

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.

See also

Applies to