ItemsControl.ItemsControlFromItemContainer Method

July 28, 2014

Returns the ItemsControl that owns the specified container element.

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

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

Parameters

container
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

Show:
© 2014 Microsoft