ItemsControl.GetItemsOwner(DependencyObject) 方法

定義

傳回指定項目 (Element) 為其裝載項目 (Item) 的 ItemsControl

public:
 static System::Windows::Controls::ItemsControl ^ GetItemsOwner(System::Windows::DependencyObject ^ element);
public static System.Windows.Controls.ItemsControl GetItemsOwner (System.Windows.DependencyObject element);
static member GetItemsOwner : System.Windows.DependencyObject -> System.Windows.Controls.ItemsControl
Public Shared Function GetItemsOwner (element As DependencyObject) As ItemsControl

參數

element
DependencyObject

裝載項目。

傳回

指定項目 (Element) 為其裝載項目 (Item) 的 ItemsControl,或是 null

備註

如果在 IsItemsHost 樣式中設為 true on element ,或者 如果 element 是 針對 ItemsPresenter 所建立的 ItemsControl 面板,則會 ItemsControl 傳回 ,否則 null 為 。

適用於