Share via


BringIntoViewRequestedEventArgs.VerticalAlignmentRatio Property

Definition

Gets the requested vertical alignment ratio which controls the alignment of the horizontal axis of the TargetRect with respect to the horizontal axis of the viewport.

public:
 property double VerticalAlignmentRatio { double get(); };
double VerticalAlignmentRatio();
public double VerticalAlignmentRatio { get; }
var double = bringIntoViewRequestedEventArgs.verticalAlignmentRatio;
Public ReadOnly Property VerticalAlignmentRatio As Double

Property Value

Double

double

The requested vertical alignment ratio between 0.0 and 1.0, or NaN. See Remarks.

Remarks

A value of NaN indicates that scrolling controls should do the minimum necessary to bring the element fully into view aligned to the nearest edge of the viewport.

Note

Do not use the == operator to test for NaN.

In C#, use Double.IsNaN() to test for NaN.

In C++, use isnan() to test for NaN.

If the value is not NaN, then the range of possible value is clamped from 0.0 to 1.0 with 0.0 representing the top horizontal edge and 1.0 representing the bottom horizontal edge.

A value of 0.0 indicates the TargetRect should be top-aligned in the viewport. A value of 1.0 indicates it should be bottom-aligned. A value of 0.5 indicates the TargetRect should be vertically centered in the viewport.

All scrolling controls that participate in bringing an element into view are expected to honor the alignment request to the extent possible. This value cannot be modified by event handlers as the event bubbles. If a control cannot fully satisfy the request then it should not alter the requested VerticalOffset property as it bubbles up.

Applies to