ItemsControlFromItemContainer Method

ItemsControl.ItemsControlFromItemContainer Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the ItemsControl that owns the specified container element.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Public Shared Function ItemsControlFromItemContainer ( _
	container As DependencyObject _
) As ItemsControl


Type: System.Windows.DependencyObject
The container element to return the ItemsControl for.

Return Value

Type: System.Windows.Controls.ItemsControl
The ItemsControl that owns the specified container element; otherwise, Nothing. The ItemsControlFromItemContainer method returns Nothing if container is not a UIElement or the parent is not an ItemsControl.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2016 Microsoft