Aracılığıyla paylaş


ScrollViewer.ChangeView Method

Definition

Overloads

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)

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>)

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);
function changeView(horizontalOffset, verticalOffset, zoomFactor)
Public Function ChangeView (horizontalOffset As Nullable(Of Double), verticalOffset As Nullable(Of Double), zoomFactor As Nullable(Of Single)) As Boolean

Parameters

horizontalOffset

IReference<Double>

Nullable<Double>

IReference<double>

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

verticalOffset

IReference<Double>

Nullable<Double>

IReference<double>

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

zoomFactor

IReference<Single>

Nullable<Single>

IReference<float>

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

Returns

Boolean

bool

true if the view is changed; otherwise, false.

Attributes

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(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:
 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 const& disableAnimation);
[Windows.Foundation.Metadata.Overload("ChangeViewWithOptionalAnimation")]
public bool ChangeView(System.Nullable<double> horizontalOffset, System.Nullable<double> verticalOffset, System.Nullable<float> zoomFactor, bool disableAnimation);
function changeView(horizontalOffset, verticalOffset, zoomFactor, 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

IReference<Double>

Nullable<Double>

IReference<double>

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

verticalOffset

IReference<Double>

Nullable<Double>

IReference<double>

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

zoomFactor

IReference<Single>

Nullable<Single>

IReference<float>

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

disableAnimation
Boolean

bool

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

Returns

Boolean

bool

true if the view is changed; otherwise, false.

Attributes

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