ItemsControl ItemsControl ItemsControl Class

Definition

Represents a control that can be used to present a collection of items.

public class ItemsControl : Control, IItemContainerMapping, IItemsControl, IItemsControl2, IItemsControl3, IItemsControlOverridespublic class ItemsControl : Control, IItemContainerMapping, IItemsControl, IItemsControl2, IItemsControl3, IItemsControlOverridesPublic Class ItemsControl Inherits Control Implements IItemContainerMapping, IItemsControl, IItemsControl2, IItemsControl3, IItemsControlOverrides
<ItemsControl ...>
  oneOrMoreItems
</ItemsControl>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods

Remarks

An ItemsControl object can serve two roles. It can be used to present a fixed set of items, or it can be used to display a list obtained from data binding to a data source. Using an ItemsControl for data is more common. To display data, specify the binding to the data as the ItemsSource value (or use the data context) and don't populate Items. If you want to display a fixed list, populate Items with one or more FrameworkElement child objects, and don't specify ItemsSource.

There are several controls that inherit from ItemsControl that you can use in your app, but you can also use an ItemsControl directly, because it does offer a basic presentation of data or items. Controls that derive from ItemsControl and which add additional presentation features include: ListView, GridView, ListBox, other Selector derived controls (ComboBox, FlipView ), MenuFlyoutPresenter.

ListView and GridView are the two most commonly used controls for displaying data. For more info on how to use these controls, including sample code, see Adding ListView and GridView controls.

ItemsSource typically references a list of items. This can be a fixed list from a business object, or a list that's designed to fire notifications if the underlying data changes. The list might be a generic interface (for example IList<T>) or a practical class that implements the collection interfaces that Windows Runtime data binding supports. When you display items in an ItemsControl, you can use the ItemTemplate property, the ItemsPanel property, or both to specify the appearance of the items. The DisplayMemberPath property can be used for a master-details view of the data. For more info on how to use these properties in data binding scenarios, how lists are supported, and how to implement two-way bindings or notifications on changes, see the "Binding to collections" section of Data binding in depth. Support for data and items is one of the areas where you'll use different interfaces and techniques for Visual C++ component extensions (C++/CX) than you do for C# or Microsoft Visual Basic; Data binding in depth also includes a table for that info.

You can provide a custom template for an ItemsControl because it is a Control class. But before retemplating ItemsControl you should check whether one of the derived classes already offers a similar template and gives you the presentation experience you want. In particular, if you're looking for data presentation that has an association with the orientation of the items (list is either horizontal or vertical) you should look at ListView and GridView.

ItemsControl implements IItemContainerMapping, which is mainly a helper interface that supports other features. App code seldom calls the IItemContainerMapping methods directly, and controls that derive from ItemsControl or any of the deeper classes typically don't have to reimplement IItemContainerMapping.

ItemsControl derived classes

ItemsControl is the parent class for MenuFlyoutPresenter and Selector. Most of the practical items controls derive from Selector in some way, either through ListViewBase or directly from Selector.

Constructors

ItemsControl() ItemsControl() ItemsControl()

Initializes a new instance of the ItemsControl class.

public ItemsControl()public ItemsControl()Public Sub New()
Attributes

Properties

DisplayMemberPath DisplayMemberPath DisplayMemberPath

Gets or sets the name or path of the property that is displayed for each data item.

public string DisplayMemberPath { get; set; }public string DisplayMemberPath { get; set; }Public ReadWrite Property DisplayMemberPath As string
<itemsControl DisplayMemberPath="propertyPath"/>
Value
string string string

The name or path of the property that is displayed for each the data item in the control. The default is an empty string ("").

Attributes

DisplayMemberPathProperty DisplayMemberPathProperty DisplayMemberPathProperty

Identifies the DisplayMemberPath dependency property.

public static DependencyProperty DisplayMemberPathProperty { get; }public static DependencyProperty DisplayMemberPathProperty { get; }Public Static ReadOnly Property DisplayMemberPathProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the DisplayMemberPath dependency property.

Attributes

GroupStyle GroupStyle GroupStyle

Gets a collection of GroupStyle objects that define the appearance of each level of groups.

public IObservableVector<GroupStyle> GroupStyle { get; }public IObservableVector<GroupStyle> GroupStyle { get; }Public ReadOnly Property GroupStyle As IObservableVector<GroupStyle>
<itemsControl>
  <itemsControl.GroupStyle>
    oneOrMoreGroupStyleObjects
  </itemsControl.GroupStyle>
</itemsControl>

Value

A collection of GroupStyle objects that define the appearance of each level of groups.

Attributes

Remarks

Note

GroupStyle.ContainerStyle and GroupStyle.ContainerStyleSelector are deprecated in Windows 8.1, and are ignored in ItemsControl.GroupStyle.

GroupStyleSelector GroupStyleSelector GroupStyleSelector

Gets or sets a reference to a custom GroupStyleSelector logic class. The GroupStyleSelector returns different GroupStyle values to use for content based on the characteristics of that content.

public GroupStyleSelector GroupStyleSelector { get; set; }public GroupStyleSelector GroupStyleSelector { get; set; }Public ReadWrite Property GroupStyleSelector As GroupStyleSelector
<itemsControl GroupStyleSelector="groupStyleSelectorReference" />
Value
GroupStyleSelector GroupStyleSelector GroupStyleSelector

A reference to a custom GroupStyleSelector logic class.

Attributes

GroupStyleSelectorProperty GroupStyleSelectorProperty GroupStyleSelectorProperty

Identifies the GroupStyleSelector dependency property.

public static DependencyProperty GroupStyleSelectorProperty { get; }public static DependencyProperty GroupStyleSelectorProperty { get; }Public Static ReadOnly Property GroupStyleSelectorProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the GroupStyleSelector dependency property.

Attributes

IsGrouping IsGrouping IsGrouping

Gets a value that indicates whether the control is using grouping.

public bool IsGrouping { get; }public bool IsGrouping { get; }Public ReadOnly Property IsGrouping As bool
Value
bool bool bool

true if a control is using grouping; otherwise, false.

Attributes

IsGroupingProperty IsGroupingProperty IsGroupingProperty

Identifies the IsGrouping dependency property.

public static DependencyProperty IsGroupingProperty { get; }public static DependencyProperty IsGroupingProperty { get; }Public Static ReadOnly Property IsGroupingProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsGrouping dependency property.

Attributes

ItemContainerGenerator ItemContainerGenerator ItemContainerGenerator

Gets the ItemContainerGenerator associated with this ItemsControl.

public ItemContainerGenerator ItemContainerGenerator { get; }public ItemContainerGenerator ItemContainerGenerator { get; }Public ReadOnly Property ItemContainerGenerator As ItemContainerGenerator
Attributes

ItemContainerStyle ItemContainerStyle ItemContainerStyle

Gets or sets the style that is used when rendering the item containers.

public Style ItemContainerStyle { get; set; }public Style ItemContainerStyle { get; set; }Public ReadWrite Property ItemContainerStyle As Style
<itemsControl>
  <itemsControl.ItemContainerStyle>
    inlineStyle
  </itemsControl.ItemContainerStyle>
</itemsControl>
Value
Style Style Style

The style applied to the item containers. The default is null.

Attributes

ItemContainerStyleProperty ItemContainerStyleProperty ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

public static DependencyProperty ItemContainerStyleProperty { get; }public static DependencyProperty ItemContainerStyleProperty { get; }Public Static ReadOnly Property ItemContainerStyleProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemContainerStyle dependency property.

Attributes

ItemContainerStyleSelector ItemContainerStyleSelector ItemContainerStyleSelector

Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to use for the item container based on characteristics of the object being displayed.

public StyleSelector ItemContainerStyleSelector { get; set; }public StyleSelector ItemContainerStyleSelector { get; set; }Public ReadWrite Property ItemContainerStyleSelector As StyleSelector
<itemsControl ItemContainerStyleSelector="styleSelectorReference" />
Attributes

ItemContainerStyleSelectorProperty ItemContainerStyleSelectorProperty ItemContainerStyleSelectorProperty

Identifies the ItemContainerStyleSelector dependency property.

public static DependencyProperty ItemContainerStyleSelectorProperty { get; }public static DependencyProperty ItemContainerStyleSelectorProperty { get; }Public Static ReadOnly Property ItemContainerStyleSelectorProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemContainerStyleSelector dependency property.

Attributes

ItemContainerTransitions ItemContainerTransitions ItemContainerTransitions

Gets or sets the collection of Transition style elements that apply to the item containers of an ItemsControl.

public TransitionCollection ItemContainerTransitions { get; set; }public TransitionCollection ItemContainerTransitions { get; set; }Public ReadWrite Property ItemContainerTransitions As TransitionCollection
<itemsControl>
  <itemsControl.ItemContainerTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </itemsControl.ItemContainerTransitions>
</itemsControl>
Value
TransitionCollection TransitionCollection TransitionCollection

The collection of Transition style elements that apply to the item containers of an ItemsControl.

Attributes

Remarks

Important

The XAML syntax for properties that have a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but TransitionCollection doesn't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Items collections can have transition animations associated with add or remove actions, or for drop target scenarios.

This property is more typically set in a Style setter rather than inline on an object element in UI definition. For more info, see Styling controls.

The default template for GridView includes existing transition animations. Specifically, the default ItemContainerTransitions value already contains values for AddDeleteThemeTransition, ContentThemeTransition, ReorderThemeTransition and EntranceThemeTransition (with IsStaggeringEnabled="False"). If you are setting a new value for ItemContainerTransitions on GridView, consider reproducing these same theme animations as a starting point.

To remove all default content transitions from a GridView, you might have to re-template the GroupStyle.ContainerStyle. The transition behavior for items and their containers are interrelated.

ItemContainerTransitionsProperty ItemContainerTransitionsProperty ItemContainerTransitionsProperty

Identifies the ItemContainerTransitions dependency property.

public static DependencyProperty ItemContainerTransitionsProperty { get; }public static DependencyProperty ItemContainerTransitionsProperty { get; }Public Static ReadOnly Property ItemContainerTransitionsProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemContainerTransitions dependency property.

Attributes

Items Items Items

Gets the collection used to generate the content of the control.

public ItemCollection Items { get; }public ItemCollection Items { get; }Public ReadOnly Property Items As ItemCollection
<itemsControl>
  oneOrMoreItems
</itemsControl>
Value
ItemCollection ItemCollection ItemCollection

The collection that is used to generate the content of the control, if it exists; otherwise, null. The default is an empty collection.

Attributes

ItemsPanel ItemsPanel ItemsPanel

Gets or sets the template that defines the panel that controls the layout of items.

public ItemsPanelTemplate ItemsPanel { get; set; }public ItemsPanelTemplate ItemsPanel { get; set; }Public ReadWrite Property ItemsPanel As ItemsPanelTemplate
<itemsControl>
  <itemsControl.ItemsPanel>
    singlePanelTemplate
  </itemsControl.ItemsPanel>
</itemsControl>
Value
ItemsPanelTemplate ItemsPanelTemplate ItemsPanelTemplate

An ItemsPanelTemplate that defines the panel to use for the layout of the items. The default value for the ItemsControl is an ItemsPanelTemplate that specifies a StackPanel.

Attributes

Remarks

Note

ComboBox uses a CarouselPanel as its ItemsPanel. Using a different panel as the ItemsPanel of ComboBox is not supported and might result in undesired behavior.

ItemsPanelProperty ItemsPanelProperty ItemsPanelProperty

Identifies the ItemsPanel dependency property.

public static DependencyProperty ItemsPanelProperty { get; }public static DependencyProperty ItemsPanelProperty { get; }Public Static ReadOnly Property ItemsPanelProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemsPanel dependency property.

Attributes

ItemsPanelRoot ItemsPanelRoot ItemsPanelRoot

Gets the Panel specified by ItemsPanel.

public Panel ItemsPanelRoot { get; }public Panel ItemsPanelRoot { get; }Public ReadOnly Property ItemsPanelRoot As Panel
Value
Panel Panel Panel

The Panel specified by ItemsPanel. The default is null.

Attributes

ItemsSource ItemsSource ItemsSource

Gets or sets an object source used to generate the content of the ItemsControl.

public object ItemsSource { get; set; }public object ItemsSource { get; set; }Public ReadWrite Property ItemsSource As object
<itemsControl ItemsSource="bindingDeclaration"/>
-or-
<itemsControl ItemsSource="resourceReferenceToSource"/>
Value
object object object

The object that is used to generate the content of the ItemsControl. The default is null.

Attributes

ItemsSourceProperty ItemsSourceProperty ItemsSourceProperty

Identifies the ItemsSource dependency property.

public static DependencyProperty ItemsSourceProperty { get; }public static DependencyProperty ItemsSourceProperty { get; }Public Static ReadOnly Property ItemsSourceProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemsSource dependency property.

Attributes

ItemTemplate ItemTemplate ItemTemplate

Gets or sets the DataTemplate used to display each item.

public DataTemplate ItemTemplate { get; set; }public DataTemplate ItemTemplate { get; set; }Public ReadWrite Property ItemTemplate As DataTemplate
<itemsControl>
  <itemsControl.ItemTemplate>
    singleDataTemplate
  </itemsControl.ItemTemplate>
</itemsControl>
Value
DataTemplate DataTemplate DataTemplate

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

Attributes

ItemTemplateProperty ItemTemplateProperty ItemTemplateProperty

Identifies the ItemTemplate dependency property.

public static DependencyProperty ItemTemplateProperty { get; }public static DependencyProperty ItemTemplateProperty { get; }Public Static ReadOnly Property ItemTemplateProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemTemplate dependency property.

Attributes

ItemTemplateSelector ItemTemplateSelector ItemTemplateSelector

Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by this property returns a template to apply to items.

public DataTemplateSelector ItemTemplateSelector { get; set; }public DataTemplateSelector ItemTemplateSelector { get; set; }Public ReadWrite Property ItemTemplateSelector As DataTemplateSelector
<itemsControl ItemTemplateSelector="dataTemplateSelectorReference" />
Attributes

ItemTemplateSelectorProperty ItemTemplateSelectorProperty ItemTemplateSelectorProperty

Identifies the ItemTemplateSelector dependency property.

public static DependencyProperty ItemTemplateSelectorProperty { get; }public static DependencyProperty ItemTemplateSelectorProperty { get; }Public Static ReadOnly Property ItemTemplateSelectorProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ItemTemplateSelector dependency property.

Attributes

Methods

ClearContainerForItemOverride(DependencyObject, Object) ClearContainerForItemOverride(DependencyObject, Object) ClearContainerForItemOverride(DependencyObject, Object)

Undoes the effects of the PrepareContainerForItemOverride method.

protected virtual void ClearContainerForItemOverride(DependencyObject element, Object item)protected virtual void ClearContainerForItemOverride(DependencyObject element, Object item)Protected Overridable Function ClearContainerForItemOverride(element As DependencyObject, item As Object) As void
Parameters
element
DependencyObject DependencyObject DependencyObject

The container element.

item
System.Object System.Object System.Object

The item.

Attributes

ContainerFromIndex(Int32) ContainerFromIndex(Int32) ContainerFromIndex(Int32)

Returns the container for the item at the specified index within the ItemCollection.

public DependencyObject ContainerFromIndex(Int32 index)public DependencyObject ContainerFromIndex(Int32 index)Public Function ContainerFromIndex(index As Int32) As DependencyObject
Parameters
index
System.Int32 System.Int32 System.Int32

The index of the item to retrieve.

Returns

The container for the item at the specified index within the item collection, if the item has a container; otherwise, null.

Attributes

ContainerFromItem(Object) ContainerFromItem(Object) ContainerFromItem(Object)

Returns the container corresponding to the specified item.

public DependencyObject ContainerFromItem(Object item)public DependencyObject ContainerFromItem(Object item)Public Function ContainerFromItem(item As Object) As DependencyObject
Parameters
item
System.Object System.Object System.Object

The item to retrieve the container for.

Returns

A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise, null.

Attributes

GetContainerForItemOverride() GetContainerForItemOverride() GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

protected virtual DependencyObject GetContainerForItemOverride()protected virtual DependencyObject GetContainerForItemOverride()Protected Overridable Function GetContainerForItemOverride() As DependencyObject
Returns

The element that is used to display the given item.

Attributes

GetItemsOwner(DependencyObject) GetItemsOwner(DependencyObject) GetItemsOwner(DependencyObject)

Returns the ItemsControl that the specified element hosts items for.

public static ItemsControl GetItemsOwner(DependencyObject element)public static ItemsControl GetItemsOwner(DependencyObject element)Public Static Function GetItemsOwner(element As DependencyObject) As ItemsControl
Parameters
Returns

The ItemsControl that the specified element hosts items for, or null.

Attributes

GroupHeaderContainerFromItemContainer(DependencyObject) GroupHeaderContainerFromItemContainer(DependencyObject) GroupHeaderContainerFromItemContainer(DependencyObject)

Returns the group header container that corresponds to the specified container element.

public DependencyObject GroupHeaderContainerFromItemContainer(DependencyObject itemContainer)public DependencyObject GroupHeaderContainerFromItemContainer(DependencyObject itemContainer)Public Function GroupHeaderContainerFromItemContainer(itemContainer As DependencyObject) As DependencyObject
Parameters
itemContainer
DependencyObject DependencyObject DependencyObject

The container element to return the group header container for.

Returns

The group header container associated with the specified item container.

Attributes

IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject)

Returns the index to the item that has the specified, generated container.

public int IndexFromContainer(DependencyObject container)public int IndexFromContainer(DependencyObject container)Public Function IndexFromContainer(container As DependencyObject) As int
Parameters
container
DependencyObject DependencyObject DependencyObject

The generated container to retrieve the item index for.

Returns
int int int

The index to the item that corresponds to the specified generated container.

Attributes

IsItemItsOwnContainerOverride(Object) IsItemItsOwnContainerOverride(Object) IsItemItsOwnContainerOverride(Object)

Determines whether the specified item is (or is eligible to be) its own container.

protected virtual bool IsItemItsOwnContainerOverride(Object item)protected virtual bool IsItemItsOwnContainerOverride(Object item)Protected Overridable Function IsItemItsOwnContainerOverride(item As Object) As bool
Parameters
item
System.Object System.Object System.Object

The item to check.

Returns
bool bool bool

true if the item is (or is eligible to be) its own container; otherwise, false.

Attributes

ItemFromContainer(DependencyObject) ItemFromContainer(DependencyObject) ItemFromContainer(DependencyObject)

Returns the item that corresponds to the specified, generated container.

public object ItemFromContainer(DependencyObject container)public object ItemFromContainer(DependencyObject container)Public Function ItemFromContainer(container As DependencyObject) As object
Parameters
container
DependencyObject DependencyObject DependencyObject

The DependencyObject that corresponds to the item to be returned.

Returns
object object object

The contained item, or the container if it does not contain an item.

Attributes

ItemsControlFromItemContainer(DependencyObject) ItemsControlFromItemContainer(DependencyObject) ItemsControlFromItemContainer(DependencyObject)

Returns the ItemsControl that owns the specified container element.

public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)Public Static Function ItemsControlFromItemContainer(container As DependencyObject) As ItemsControl
Parameters
container
DependencyObject DependencyObject DependencyObject

The container element to return the ItemsControl for.

Returns

The ItemsControl that owns the specified container element; otherwise, null.

Attributes

OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector) OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector) OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector)

Invoked when the value of the GroupStyleSelector property changes.

protected virtual void OnGroupStyleSelectorChanged(GroupStyleSelector oldGroupStyleSelector, GroupStyleSelector newGroupStyleSelector)protected virtual void OnGroupStyleSelectorChanged(GroupStyleSelector oldGroupStyleSelector, GroupStyleSelector newGroupStyleSelector)Protected Overridable Function OnGroupStyleSelectorChanged(oldGroupStyleSelector As GroupStyleSelector, newGroupStyleSelector As GroupStyleSelector) As void
Parameters
oldGroupStyleSelector
GroupStyleSelector GroupStyleSelector GroupStyleSelector

The previous value of the GroupStyleSelector property.

newGroupStyleSelector
GroupStyleSelector GroupStyleSelector GroupStyleSelector

The current value of the GroupStyleSelector property.

Attributes

OnItemContainerStyleChanged(Style, Style) OnItemContainerStyleChanged(Style, Style) OnItemContainerStyleChanged(Style, Style)

Invoked when the value of the ItemContainerStyle property changes.

protected virtual void OnItemContainerStyleChanged(Style oldItemContainerStyle, Style newItemContainerStyle)protected virtual void OnItemContainerStyleChanged(Style oldItemContainerStyle, Style newItemContainerStyle)Protected Overridable Function OnItemContainerStyleChanged(oldItemContainerStyle As Style, newItemContainerStyle As Style) As void
Parameters
oldItemContainerStyle
Style Style Style

The previous value of the ItemContainerStyle property.

newItemContainerStyle
Style Style Style

The current value of the ItemContainerStyle property.

Attributes

OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector) OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector) OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector)

Invoked when the value of the ItemContainerStyleSelector property changes.

protected virtual void OnItemContainerStyleSelectorChanged(StyleSelector oldItemContainerStyleSelector, StyleSelector newItemContainerStyleSelector)protected virtual void OnItemContainerStyleSelectorChanged(StyleSelector oldItemContainerStyleSelector, StyleSelector newItemContainerStyleSelector)Protected Overridable Function OnItemContainerStyleSelectorChanged(oldItemContainerStyleSelector As StyleSelector, newItemContainerStyleSelector As StyleSelector) As void
Parameters
oldItemContainerStyleSelector
StyleSelector StyleSelector StyleSelector

The previous value of the ItemContainerStyleSelector property.

newItemContainerStyleSelector
StyleSelector StyleSelector StyleSelector

The current value of the ItemContainerStyleSelector property.

Attributes

OnItemsChanged(Object) OnItemsChanged(Object) OnItemsChanged(Object)

Invoked when the value of the Items property changes.

protected virtual void OnItemsChanged(Object e)protected virtual void OnItemsChanged(Object e)Protected Overridable Function OnItemsChanged(e As Object) As void
Parameters
e
System.Object System.Object System.Object

Event data. Not specifically typed in the current implementation.

Attributes

OnItemTemplateChanged(DataTemplate, DataTemplate) OnItemTemplateChanged(DataTemplate, DataTemplate) OnItemTemplateChanged(DataTemplate, DataTemplate)

Invoked when the value of the ItemTemplate property changes.

protected virtual void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate)protected virtual void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate)Protected Overridable Function OnItemTemplateChanged(oldItemTemplate As DataTemplate, newItemTemplate As DataTemplate) As void
Parameters
oldItemTemplate
DataTemplate DataTemplate DataTemplate

The previous value of the ItemTemplate property.

newItemTemplate
DataTemplate DataTemplate DataTemplate

The current value of the ItemTemplate property.

Attributes

OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector) OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector) OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

Invoked when the value of the ItemTemplateSelector property changes.

protected virtual void OnItemTemplateSelectorChanged(DataTemplateSelector oldItemTemplateSelector, DataTemplateSelector newItemTemplateSelector)protected virtual void OnItemTemplateSelectorChanged(DataTemplateSelector oldItemTemplateSelector, DataTemplateSelector newItemTemplateSelector)Protected Overridable Function OnItemTemplateSelectorChanged(oldItemTemplateSelector As DataTemplateSelector, newItemTemplateSelector As DataTemplateSelector) As void
Parameters
oldItemTemplateSelector
DataTemplateSelector DataTemplateSelector DataTemplateSelector

The previous value of the ItemTemplateSelector property.

newItemTemplateSelector
DataTemplateSelector DataTemplateSelector DataTemplateSelector

The current value of the ItemTemplateSelector property.

Attributes

PrepareContainerForItemOverride(DependencyObject, Object) PrepareContainerForItemOverride(DependencyObject, Object) PrepareContainerForItemOverride(DependencyObject, Object)

Prepares the specified element to display the specified item.

protected virtual void PrepareContainerForItemOverride(DependencyObject element, Object item)protected virtual void PrepareContainerForItemOverride(DependencyObject element, Object item)Protected Overridable Function PrepareContainerForItemOverride(element As DependencyObject, item As Object) As void
Parameters
element
DependencyObject DependencyObject DependencyObject

The element that's used to display the specified item.

item
System.Object System.Object System.Object

The item to display.

Attributes

See Also