Freigeben über


ItemsControl.GetItemsOwner Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns the ItemsControl that the specified element hosts items for.

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

Syntax

'Declaration
Public Shared Function GetItemsOwner ( _
    element As DependencyObject _
) As ItemsControl
public static ItemsControl GetItemsOwner(
    DependencyObject element
)

Parameters

Return Value

Type: System.Windows.Controls.ItemsControl
The ItemsControl that the specified element hosts items for, or nulla null reference (Nothing in Visual Basic).

Remarks

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 nulla null reference (Nothing in Visual Basic).

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.