ItemsControl.GetItemsOwner Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns the ItemsControl that the specified element hosts items for.
Assembly: System.Windows (in System.Windows.dll)
'Declaration Public Shared Function GetItemsOwner ( _ element As DependencyObject _ ) As ItemsControl
Parameters
- element
- Type: System.Windows.DependencyObject
The host element.
Return Value
Type: System.Windows.Controls.ItemsControlThe ItemsControl that the specified element hosts items for, or Nothing.
If the IsItemsHost property is set to true on element in a style or if element is a panel created by the ItemsPresenter for an ItemsControl, the associated ItemsControl is returned; otherwise, the GetItemsOwner method returns Nothing.
Show: