ContentControl.OnContentTemplateSelectorChanged 方法

定义

ContentTemplateSelector 属性的值更改时调用。

void OnContentTemplateSelectorChanged(DataTemplateSelector const& oldContentTemplateSelector, DataTemplateSelector const& newContentTemplateSelector);
protected virtual void OnContentTemplateSelectorChanged(DataTemplateSelector oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector);
function onContentTemplateSelectorChanged(oldContentTemplateSelector, newContentTemplateSelector)
Protected Overridable Sub OnContentTemplateSelectorChanged (oldContentTemplateSelector As DataTemplateSelector, newContentTemplateSelector As DataTemplateSelector)

参数

oldContentTemplateSelector
DataTemplateSelector

ContentTemplateSelector 属性的旧值。

newContentTemplateSelector
DataTemplateSelector

ContentTemplateSelector 属性的新值。

注解

派生自 ContentControl 的类可以重写此方法,以便在选择器逻辑根据上下文更改自动选择 DataTemplate 的情况下执行应应用的任何自定义逻辑。

适用于