ScrollViewer.AnchorRequested 事件

定义

在排列传递的开头请求定位点时发生。 处理此事件以替代 ScrollViewer 的默认逻辑,以选择定位点元素作为 滚动定位的一部分。

// Register
event_token AnchorRequested(TypedEventHandler<ScrollViewer, AnchorRequestedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
ScrollViewer::AnchorRequested_revoker AnchorRequested(auto_revoke_t, TypedEventHandler<ScrollViewer, AnchorRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<ScrollViewer,AnchorRequestedEventArgs> AnchorRequested;
function onAnchorRequested(eventArgs) { /* Your code */ }
scrollViewer.addEventListener("anchorrequested", onAnchorRequested);
scrollViewer.removeEventListener("anchorrequested", onAnchorRequested);
- or -
scrollViewer.onanchorrequested = onAnchorRequested;
Public Custom Event AnchorRequested As TypedEventHandler(Of ScrollViewer, AnchorRequestedEventArgs) 

事件类型

注解

AnchorRequestedEventArgsAnchor 属性显式设置为 ScrollViewer 子树中的 UIElement,以替代选择定位点元素的默认策略。 AnchorCandidates 属性提供当前向 ScrollViewer 注册的候选项列表。

适用于

另请参阅