共用方式為


ScrollViewer.AnchorRequested 事件

定義

發生于 Arrange pass 開頭要求錨點時。 處理此事件以覆寫 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) 

事件類型

Windows 需求

裝置系列
Windows 10, version 1809 (已於 10.0.17763.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v7.0 引進)

備註

明確將AnchorRequestedEventArgsAnchor屬性設定為ScrollViewer子樹內的 UIElement,以覆寫選擇錨點元素的預設原則。 AnchorCandidates屬性提供目前向ScrollViewer註冊的候選項目清單。

適用於

另請參閱