我需要调整控件的高度:trvMenu
,StackPanel (Grid.Column="1")
,StackPanel(Grid.Column="3")
和高度+宽度 :tabControl
(宽度到左边)。我只需要它们在运行时适合应用程序窗口的大小,例如全屏。这是xaml:
<Window x:Class="DiagramDesigner.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
<TreeView Name="trvMenu" HorizontalAlignment="Left" Height="312"
...
</TreeView>
...
<StackPanel Grid.Column="1">
...
</StackPanel>
</Border>
...
<TabControl x:Name="tabControl" Grid.Column="2" SelectionChanged="tabDynamic_SelectionChanged" ItemsSource="{Binding}">
...
</TabControl>
<StackPanel Grid.Column="3">
...
</StackPanel>
...
答案 0 :(得分:0)
答案是首先根据应用程序的结构构建网格,并且需要调整到窗口大小的每个列或行应该具有:
<Grid.RowDefinitions>
...
<RowDefinition Height="*" />
...
</Grid.RowDefinitions>
和
<Grid.ColumnDefinitions>
...
<ColumnDefinition Width="*"/>
...
</Grid.ColumnDefinitions>