我无法在制表符控件中获取制表符控件来填充其容器。我认为这是一些我忽视或尚未找到的简单属性。在下面的xaml中,我希望TabControl'sub'能够完全填充画布'canvas2'。
谢谢你, Venkat
<Border BorderBrush="AliceBlue" BorderThickness="1,1,1,1">
<TabControl name="Main">
<TabItem Header="Test1">
<DockPanel LastChildFill="True">
<Border BorderBrush="Green" BorderThickness="1,1,1,1">
<Canvas Width="350" Height="200" DockPanel.Dock="Left">
</Canvas>
</Border>
<Border BorderBrush="Red" BorderThickness="1,1,1,1">
<Canvas name="canvas2">
<Border BorderBrush="Yellow" BorderThickness="1,1,1,1">
<TabControl Height="600" HorizontalAlignment="Stretch" name="sub">
<TabItem Header="Rights Test 1" HorizontalAlignment="Stretch">
<Canvas></Canvas>
</TabItem>
<TabItem Header="Rights Test 2">
<Canvas></Canvas>
</TabItem>
</TabControl>
</Border>
</Canvas>
</Border>
</DockPanel>
</TabItem>
</TabControl>
</Border>
<Border BorderBrush="AliceBlue" BorderThickness="1,1,1,1">
<TabControl name="Main">
<TabItem Header="Test1">
<DockPanel LastChildFill="True">
<Border BorderBrush="Green" BorderThickness="1,1,1,1">
<Canvas Width="350" Height="200" DockPanel.Dock="Left">
</Canvas>
</Border>
<Border BorderBrush="Red" BorderThickness="1,1,1,1">
<Canvas name="canvas2">
<Border BorderBrush="Yellow" BorderThickness="1,1,1,1">
<TabControl Height="600" HorizontalAlignment="Stretch" name="sub">
<TabItem Header="Rights Test 1" HorizontalAlignment="Stretch">
<Canvas></Canvas>
</TabItem>
<TabItem Header="Rights Test 2">
<Canvas></Canvas>
</TabItem>
</TabControl>
</Border>
</Canvas>
</Border>
</DockPanel>
</TabItem>
</TabControl>
</Border>
答案 0 :(得分:2)
Canvas不会伸展以填充他们给定的空间。所以摆脱canvas2。