Dela via


UIElement.BringIntoViewRequested Event

Definition

Occurs when StartBringIntoView is called on this element or one of its descendants.

// Register
event_token BringIntoViewRequested(TypedEventHandler<UIElement, BringIntoViewRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void BringIntoViewRequested(event_token const* cookie) const;

// Revoke with event_revoker
UIElement::BringIntoViewRequested_revoker BringIntoViewRequested(auto_revoke_t, TypedEventHandler<UIElement, BringIntoViewRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<UIElement,BringIntoViewRequestedEventArgs> BringIntoViewRequested;
function onBringIntoViewRequested(eventArgs) { /* Your code */ }
uIElement.addEventListener("bringintoviewrequested", onBringIntoViewRequested);
uIElement.removeEventListener("bringintoviewrequested", onBringIntoViewRequested);
- or -
uIElement.onbringintoviewrequested = onBringIntoViewRequested;
Public Custom Event BringIntoViewRequested As TypedEventHandler(Of UIElement, BringIntoViewRequestedEventArgs) 

Event Type

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Remarks

Note

The framework may also raise the event in response to the element receiving focus via a keyboard or gamepad, or when an assistive technology executes the IScrollItemProvider's ScrollIntoView method on the element's automation peer.

This event enables a control to participate in the process of bringing an element into view. It indicates to a parent control, such as a ScrollViewer, that the element which raised the event should be made visible within the scrollable region. Non-scrolling controls may use the event as a way to alter requests that originate from one of its children by modifying the event data (BringIntoViewRequestedEventArgs). For example, you may listen to the event on a parent element to enlarge the TargetRect and ensure a minimum amount of padding is included when bringing any of its child elements into view.

In general, the event data (BringIntoViewRequestedEventArgs) should not be marked handled. Doing so may interfere with the intended goal when StartBringIntoView was called. Other event data may be modified as the event bubbles up to alter the request. Specifically, a parent scrolling control is expected to modify the event data to account for its contribution, whether it partially or fully satisfies the request. At a minimum, a scroller is expected to set itself as the TargetElement and update the TargetRect to its own coordinate space. For situations where the element is within a scroller that itself is within a scroller each must react to satisfy the requested alignment.

The OriginalSource should be used to determine the element on which the event was originally raised given that the TargetElement may be modified as the event bubbles.

BringIntoViewRequested is a routed event. For more info on the routed event concept, see Events and routed events overview.

Applies to

See also