필자는 하나의 컨트롤을 채우도록 설정하고 나머지는 도킹을 설정하는 논리적이고 간단한 방법을 원합니다. 다음과 같이 사용할 수 있습니다 :WPF : FirstChildFill이있는 StackPanel?
<DockPanel LastChildFill="True">
<Button Content="3" DockPanel.Dock="Bottom" />
<Button Content="2" DockPanel.Dock="Bottom" />
<Button Content="1" />
</DockPanel>
그러나 매우 직관적 인 것은 아닙니다. 나는 이런 식으로 그것을 할도 수 :
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button Content="1" Grid.Row="0" />
<Button Content="2" Grid.Row="1" />
<Button Content="3" Grid.Row="2" />
</Grid>
그러나 XAML의 그것도 꽤 많이 있습니다. 이 같은 내가 정말 원하는이다
이이 DockPanel과 같은 항목을 반전하지 않아도 및 그리드와 같이 행과 연결된 속성의 고정 번호를 사용하지 않으면 서 달성 할 수있는 방법을<StackPanel Fill="None|First|Last">
<Button Content="1" />
<Button Content="2" />
<Button Content="3" />
</StackPanel>
?
감사! 이것은 나를 시작하게 만들 것입니다 ... –