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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈