DataTemplateSelector.OnSelectTemplate(Object, BindableObject) Method

Definition

The developer overrides this method to return a valid data template for the specified item. This method is called by SelectTemplate(Object, BindableObject).

protected abstract Xamarin.Forms.DataTemplate OnSelectTemplate (object item, Xamarin.Forms.BindableObject container);
abstract member OnSelectTemplate : obj * Xamarin.Forms.BindableObject -> Xamarin.Forms.DataTemplate

Parameters

item
Object

The data for which to return a template.

container
BindableObject

An optional container object in which the developer may have opted to store DataTemplateSelector objects.

Returns

A developer-defined DataTemplate that can be used to display item.

Remarks

This method causes SelectTemplate(Object, BindableObject) to throw an exception if it returns an instance of DataTemplateSelector.

Applies to