Gets a UIElementCollection of child elements.
Assembly: PresentationFramework (in PresentationFramework.dll)
The example defines a simple custom Panel element called PlotPanel, which positions child elements according to two hard-coded x- and y-coordinates. In this example, x and y are both set to 50; therefore, all child elements are positioned at that location on the x and y axes.
Public Class PlotPanel Inherits Panel 'Override the default Measure method of Panel. Protected Overrides Function MeasureOverride(ByVal availableSize As System.Windows.Size) As System.Windows.Size Dim panelDesiredSize As Size = New Size() ' In our example, we just have one child. ' Report that our panel requires just the size of its only child. For Each child As UIElement In InternalChildren child.Measure(availableSize) panelDesiredSize = child.DesiredSize Next Return panelDesiredSize End Function Protected Overrides Function ArrangeOverride(ByVal finalSize As System.Windows.Size) As System.Windows.Size For Each child As UIElement In InternalChildren Dim x As Double = 50 Dim y As Double = 50 child.Arrange(New Rect(New System.Windows.Point(x, y), child.DesiredSize)) Next Return finalSize End Function End Class
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.