在 WPF 中,如何在一个区域(宽阔的水平区域)上展开/拉伸内容?
像这样:
这是我当前的代码(来自图片的上部):
<Grid Width="900">
<ScrollViewer x:Name="sclScroller" HorizontalScrollBarVisibility="Hidden">
<Viewbox HorizontalAlignment="Stretch">
<DockPanel>
<TextBlock Name="txtContent1" Text="1" />
<TextBlock Name="txtContent2" Text="2" />
<TextBlock Name="txtContent3" Text="3" />
<TextBlock Name="txtContent4" Text="4" />
<TextBlock Name="txtContent5" Text="5" />
<TextBlock Name="txtContent6" Text="6" />
<TextBlock Name="txtContent7" Text="7" />
<TextBlock Name="txtContent8" Text="8" />
</DockPanel>
</Viewbox>
</ScrollViewer>
</Grid>