ItemsControl.ContainerFromElement Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the container that belongs to the current ItemsControl that owns the given container element.
Overloads
ContainerFromElement(DependencyObject) |
Returns the container that belongs to the current ItemsControl that owns the given element. |
ContainerFromElement(ItemsControl, DependencyObject) |
Returns the container that belongs to the specified ItemsControl that owns the given container element. |
ContainerFromElement(DependencyObject)
Returns the container that belongs to the current ItemsControl that owns the given element.
public:
System::Windows::DependencyObject ^ ContainerFromElement(System::Windows::DependencyObject ^ element);
public System.Windows.DependencyObject ContainerFromElement (System.Windows.DependencyObject element);
member this.ContainerFromElement : System.Windows.DependencyObject -> System.Windows.DependencyObject
Public Function ContainerFromElement (element As DependencyObject) As DependencyObject
Parameters
- element
- DependencyObject
The element to return the container for.
Returns
The container that belongs to the current ItemsControl that owns the given element or null
if no such container exists.
See also
Applies to
ContainerFromElement(ItemsControl, DependencyObject)
Returns the container that belongs to the specified ItemsControl that owns the given container element.
public:
static System::Windows::DependencyObject ^ ContainerFromElement(System::Windows::Controls::ItemsControl ^ itemsControl, System::Windows::DependencyObject ^ element);
public static System.Windows.DependencyObject ContainerFromElement (System.Windows.Controls.ItemsControl itemsControl, System.Windows.DependencyObject element);
static member ContainerFromElement : System.Windows.Controls.ItemsControl * System.Windows.DependencyObject -> System.Windows.DependencyObject
Public Shared Function ContainerFromElement (itemsControl As ItemsControl, element As DependencyObject) As DependencyObject
Parameters
- itemsControl
- ItemsControl
The ItemsControl to return the container for.
- element
- DependencyObject
The element to return the container for.
Returns
The container that belongs to the specified ItemsControl that owns the given element, if itemsControl
is not null
. If itemsControl
is null
, returns the closest container that belongs to any ItemsControl.
See also
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應