Share via


ItemsRepeater.ItemTemplate 屬性

定義

取得或設定用來顯示每個專案的範本。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 property Platform::Object ^ ItemTemplate { Platform::Object ^ get(); void set(Platform::Object ^ value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IInspectable ItemTemplate();

void ItemTemplate(IInspectable value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IInspectable ItemTemplate();

void ItemTemplate(IInspectable value);
public object ItemTemplate { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public object ItemTemplate { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
Public Property ItemTemplate As Object

屬性值

Object

Platform::Object

IInspectable

指定資料物件視覺效果的範本。 預設值為 null

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

備註

將此屬性設定為 Factory 物件,用來產生指定資料項目的 UIElement。 這可以是 DataTemplate、DataTemplateSelector,或IElementFactory的自訂實作,由一些其他機制建立 UIElement,例如XamlDirect

重要

在 Windows 10 版本 1809 或更新版本上執行時,這可以是支援 IElementFactory 的任何物件。 在舊版Windows 10上,這必須是 DataTemplate 或 DataTemplateSelector。

產生的專案可能會重複使用。 例如,在索引 0 上顯示專案所產生的專案,稍後可能會重複使用,以在索引 100 上顯示專案。

適用於