ScrollViewer.RegisterAnchorCandidate(UIElement) 方法

定義

UIElement 註冊為潛在的捲動錨點。

public:
 virtual void RegisterAnchorCandidate(UIElement ^ element) = RegisterAnchorCandidate;
void RegisterAnchorCandidate(UIElement const& element);
public void RegisterAnchorCandidate(UIElement element);
function registerAnchorCandidate(element)
Public Sub RegisterAnchorCandidate (element As UIElement)

參數

element
UIElement

ScrollViewer子樹內的UIElement

實作

Windows 需求

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

備註

當元素的 CanBeScrollAnchor 設定為 true 時,架構會在該專案的上階鏈結中找到第一個 IScrollAnchorProvider ,並自動呼叫其 RegisterAnchorCandidate 方法。 當已在現有專案上設定 屬性或已設定 屬性的即時樹狀結構中加入專案時,就會發生此情況。

同樣地,當屬性設定為false (或從視覺化樹狀結構中移除元素,並將 屬性設定為 true) 時,架構會在第一個IScrollAnchorProvider上呼叫UnregisterAnchorCandidate

適用於

另請參閱