DataTemplateSelector.SelectTemplate(Object) method

Applies to Windows and Windows Phone

Returns a specific DataTemplate for a given item.

Syntax


public DataTemplate SelectTemplate(
  object item
)

Parameters

item

Type: System.Object [.NET] | Platform::Object [C++]

The item to return a template for.

Return value

Type: DataTemplate

The template to use for the given item and/or container.

Remarks

App code typically doesn't call SelectTemplate methods; the methods exists so that the infrastructure can call it while choosing the correct templates based on using a DataTemplateSelector instance from a property value such as ItemsControl.ItemsTemplateSelector. To provide a specific template in a derived class, override the SelectTemplateCore(Object) method.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

DataTemplateSelector
SelectTemplate(Object, DependencyObject)
Adding ListView and GridView controls

 

 

Show:
© 2015 Microsoft