Dela via


BringIntoViewRequestedEventArgs.HorizontalAlignmentRatio Property

Definition

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

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

Property Value

Double

double

The requested horizontal 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 left vertical edge and 1.0 representing the right vertical edge.

A value of 0.0 indicates the TargetRect should be left-aligned in the viewport. A value of 1.0 indicates it should be right-aligned. A value of 0.5 indicates the TargetRect should be horizontally 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 HorizontalOffset property as it bubbles up.

Applies to