```
<Grid x:Name="mainGrid">
                <Border BorderBrush="Black">
                        <Grid Name="detailGrid">

```

Here, the `detailGrid` and its `border` takes complete Width and Height, as available from the outer `mainGrid`, where as the contents inside the `detailGrid` are having Width and Height that is much much lesser.

How can I constrain the Width and Height of `Border` or/and `detailGrid` to fit to its contents, so the the Outer Grid's background is visible ?