In response to Joe’s comment on the Canvas article about how the Canvas control deals with the Measure/Arrange process when it is laid out by a parent Panel:
It seems that during Measure/Arrange process the child Canvas will take zero width and height provided these properties are not set, even if it contains some controls. Here is a little example:
XAML:
<UserControl x:Class="CanvasInCanvas.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas x:Name="cnvControlHolder" Background="White" Height="300" Width="400">
<Canvas x:Name="cnvInner" Canvas.Top="10" Canvas.Left="10" Background="Blue">
<Button x:Name="btnHello" Content="Hello Joe :)" Canvas.Top="0" Canvas.Left="0" Margin="10"></Button>
</Canvas>
</Canvas>
</UserControl>
We don’t see the Blue background of the inner Canvas because its size is zero.