Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
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. |
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
The element to return the container for.
The container that belongs to the current ItemsControl that owns the given element or null
if no such container exists.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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
The ItemsControl to return the container for.
The element to return the container for.
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.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in