共用方式為


ContentPresenter.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屬性的新值。

備註

衍生自 ContentPresenter 的類別可以覆寫這個方法,以執行應該套用的任何自訂邏輯,以防選取器邏輯根據內容變更自動選擇 DataTemplate

適用於