Share via


ItemsRepeater.ItemTemplate Property

Definition

Gets or sets the template used to display each item.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

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

Property Value

Object

Platform::Object

IInspectable

The template that specifies the visualization of the data objects. The default is null.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

Remarks

Set this property to a factory object used to generate a UIElement for a given data item. This can be a DataTemplate, a DataTemplateSelector, or a custom implementation of IElementFactory that creates UIElements by some other mechanism, like XamlDirect.

Important

When running on Windows 10, version 1809 or later, this can be any object that supports IElementFactory. On earlier versions of Windows 10, this must be a DataTemplate or DataTemplateSelector.

Generated elements might be re-used. For example, an element generated to display the item at index 0 might be reused later to display the item at index 100.

Applies to