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

適用於