ScrollViewer.ChangeView ScrollViewer.ChangeView ScrollViewer.ChangeView ScrollViewer.ChangeView Method

Definition

Overloads

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

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

ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<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(IReference<Double>, IReference<Double>, IReference<Single>) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>)

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

public : Platform::Boolean ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset, IReference<float> zoomFactor)
bool ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset, IReference<Single> zoomFactor) const;
public bool ChangeView(Nullable<Double> horizontalOffset, Nullable<Double> verticalOffset, Nullable<Single> zoomFactor)
Public Function ChangeView(horizontalOffset As Nullable(Of Double), verticalOffset As Nullable(Of Double), zoomFactor As Nullable(Of Single)) As bool

Parameters

horizontalOffset
Nullable<Double> Nullable<Double>

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

verticalOffset
Nullable<Double> Nullable<Double>

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

zoomFactor
Nullable<Single> Nullable<Single>

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

Returns

bool bool

true if the view is changed; otherwise, false.

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

ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean) ChangeView(IReference<Double>, IReference<Double>, IReference<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 : Platform::Boolean ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset, IReference<float> zoomFactor, bool disableAnimation)
bool ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset, IReference<Single> zoomFactor, bool disableAnimation) const;
public bool ChangeView(Nullable<Double> horizontalOffset, Nullable<Double> verticalOffset, Nullable<Single> zoomFactor, Boolean disableAnimation)
Public Function ChangeView(horizontalOffset As Nullable(Of Double), verticalOffset As Nullable(Of Double), zoomFactor As Nullable(Of Single), disableAnimation As Boolean) As bool

Parameters

horizontalOffset
Nullable<Double> Nullable<Double>

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

verticalOffset
Nullable<Double> Nullable<Double>

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

zoomFactor
Nullable<Single> Nullable<Single>

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

disableAnimation
Boolean Boolean

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

Returns

bool bool

true if the view is changed; otherwise, false.

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