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

实现

注解

当元素的 CanBeScrollAnchor 设置为 true 时,框架会在该元素的上级链中找到第一个 IScrollAnchorProvider ,并自动调用其 RegisterAnchorCandidate 方法。 在现有元素上设置 属性或将元素添加到已设置 属性的实时树时,都会出现这种情况。

同样,当属性设置为 false (或者从可视化树中删除元素(属性设置为 true) ),框架在第一个 IScrollAnchorProvider 上调用 UnregisterAnchorCandidate

适用于

另请参阅