xaml要求简单的方法

时间:2014-04-30 12:21:09

标签: c# wpf

有任何方法可以不使用rowdefinition 像所有的东西一个接一个地设置 喜欢html

   <Grid Grid.Row="1" Height="auto"  Width="300" Background="#FF343434" x:Name="new_order">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />

                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="Order:Table 1" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="24" Margin="5" ></TextBlock>
                    <TextBlock Grid.Row="0" Text="set in 10:00" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="16" Margin="3"></TextBlock>

1 个答案:

答案 0 :(得分:1)

我认为您正在寻找StackPanel

<StackPanel>
    <TextBlock Text="Row 1" />
    <TextBlock Text="Row 2" />
    <TextBlock Text="Row 3" />
</StackPanel>