У меня есть следующий XAML, который отображает панель стека текстовых блоков.Из-за моего основного размера сетки последние несколько элементов на панели стека естественным образом обрезаются.Однако, если я перевожу родительскую сетку панели стека (а не основную сетку) вертикально вверх, содержимое панели стека все равно будет обрезано вместо отображения элементов внизу.Как я могу выполнить вертикальный перевод на сетке, не обрезая нижнее содержимое панели стека?
Важно окно просмотра - поскольку первая сетка должна масштабироваться до максимальной высоты основного окна или монитора.
<Window x:Class="WpfApplication5.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow">
<Viewbox>
<Grid Width="500" Height="888" Background="#cccccc">
<Grid Background="#cc99cc">
<Grid.RenderTransform>
<TranslateTransform Y="-800"/>
</Grid.RenderTransform>
<StackPanel>
<TextBlock Text="This is a test 1" FontSize="50" Foreground="Blue"/>
<TextBlock Text="This is a test 2" FontSize="50" Foreground="Red"/>
<TextBlock Text="This is a test 3" FontSize="50" Foreground="Green"/>
<TextBlock Text="This is a test 4" FontSize="50" Foreground="Orange"/>
<TextBlock Text="This is a test 5" FontSize="50" Foreground="Yellow"/>
<TextBlock Text="This is a test 6" FontSize="50" Foreground="Purple"/>
<TextBlock Text="This is a test 7" FontSize="50" Foreground="Blue"/>
<TextBlock Text="This is a test 8" FontSize="50" Foreground="Red"/>
<TextBlock Text="This is a test 9" FontSize="50" Foreground="Green"/>
<TextBlock Text="This is a test 10" FontSize="50" Foreground="Orange"/>
<TextBlock Text="This is a test 11" FontSize="50" Foreground="Yellow"/>
<TextBlock Text="This is a test 12" FontSize="50" Foreground="Purple"/>
<TextBlock Text="This is a test 13" FontSize="50" Foreground="Blue"/>
<TextBlock Text="This is a test 14" FontSize="50" Foreground="Red"/>
<TextBlock Text="This is a test 15" FontSize="50" Foreground="Green"/>
<TextBlock Text="This is a test 16" FontSize="50" Foreground="Orange"/>
</StackPanel>
</Grid>
</Grid>
</Viewbox>
</Window>