如何在Viewbox中拉伸Grid

时间:2016-07-20 12:18:47

标签: .net xaml grid viewbox

我想在Grid内展开Viewbox。我有上帝的代码不能正常工作。任何线索?

 <Viewbox HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
         <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
 </Grid>
</Viewbox>

enter image description here

2 个答案:

答案 0 :(得分:4)

答案 1 :(得分:1)

将Viewbox的strech属性更改为Fill,如下所示。

&LT; Viewbox Stretch =&#34;填充&#34; &GT;

相关问题