Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Border.Child Property

Silverlight

Gets or sets the child element to draw the border around.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

public UIElement Child { get; set; }
<Border>
  singleChild
</Border>

XAML Values

singleChild

A single object element that the border encloses. This child must be an object that derives from UIElement.

Property Value

Type: System.Windows.UIElement
The UIElement to apply the border to.

Border can have only one child object. To apply a border around multiple objects, wrap the elements in a container (StackPanel, Grid, or Canvas, for example) and put the border around the container.

Child is the XAML content property for Border. A content item for a Border sets the Child property; a Border.Child property element is not required to enclose the content.

The following example shows how to wrap a border around multiple objects using a StackPanel as the container.


<Border BorderThickness="5" BorderBrush="Blue" >
    <StackPanel Grid.Column="0" Grid.Row="0">
        <TextBlock Text="One"/>
        <TextBlock Text="Two"/>
        <TextBlock Text="Three"/>
    </StackPanel>
</Border>


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show:
© 2014 Microsoft