ContentControl.OnContentChanged(Object, Object) 方法

定义

Content 属性的值更改时调用。

protected:
 virtual void OnContentChanged(Platform::Object ^ oldContent, Platform::Object ^ newContent) = OnContentChanged;
void OnContentChanged(IInspectable const& oldContent, IInspectable const& newContent);
protected virtual void OnContentChanged(object oldContent, object newContent);
function onContentChanged(oldContent, newContent)
Protected Overridable Sub OnContentChanged (oldContent As Object, newContent As Object)

参数

oldContent
Object

Platform::Object

IInspectable

Content 属性的旧值。

newContent
Object

Platform::Object

IInspectable

Content 属性的新值。

注解

如果存在 ContentTemplateSelector 的值,则默认实现在实现的 DataTemplateSelector 上调用 SelectTemplate,将 newContent 值作为传递,并将调用 ContentControl 作为容器传递。 然后,返回值会自动在调用方上设置 ContentTemplate

适用于