我对Silverlight非常陌生,所以我很抱歉如果这个问题很明显,但我想创建一个类似于HTML表的任何数量的行,从1到x。Silverlight动态大小的表
我需要该表与增加的行数一起增长。此外,我希望能够将表格的宽度和高度作为一个整体进行设置,并使每行中的所有文本都能够适当地动态调整大小。
这样的XAML会是什么样子?
干杯,克里斯。
编辑:
感谢您的答复,看来我要的是制成归档此的所有建议的混合物:
<Grid x:Name="ExampleGrid" Height="150" Width="300" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Viewbox Stretch="Fill" Grid.Row="0">
<!-- Two column header -->
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text One" Height="Auto" />
<TextBlock Text="Text One" Height="Auto" />
</StackPanel>
</Viewbox>
<Viewbox Stretch="Fill" Grid.Row="1">
<TextBlock Text="Text Two" Height="Auto" />
</Viewbox>
<Viewbox Stretch="Fill" Grid.Row="2">
<TextBlock Text="Text Three" Height="Auto"/>
</Viewbox>
网格应该用于布局,而不是用于动态数据。但是,他的问题很难说他真的在寻找什么。 – 2009-04-22 15:01:05
好点,先生! – STW 2009-04-22 15:27:47