ItemsRepeater.ItemTemplate Property

Definition

Gets or sets the template used to display each item.

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);
[get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public object ItemTemplate { get; set; }
[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 { get; set; }
Public Property ItemTemplate As Object

Property Value

Object

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

Attributes

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, a RecyclingElementFactory, 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