共用方式為


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) 

事件類型

備註

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

適用於

另請參閱