我正在尝试使用 ItemsControl 来显示 DataTemplate。我有这个简单的例子:
<navigation:Page.Resources>
<DataTemplate x:Key="PictureResultsTemplate">
<!--<Grid/> -->
<TextBlock Text="Nick Was Here"></TextBlock>
</DataTemplate>
</navigation:Page.Resources>
<Grid x:Name="LayoutRoot">
<Grid Margin="0,0,8,8">
<Grid.RowDefinitions>
<RowDefinition Height="0.102*"/>
<RowDefinition Height="0.898*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl x:Name="PictureResults" Margin="0,8,0,0" Grid.Row="2" ItemTemplate="{StaticResource PictureResultsTemplate}">
</ItemsControl>
</Grid>
</Grid>
为什么文本块文本不可见?谢谢!