Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# items控件项不会在Windows Phone应用程序的ScrollViewer中呈现_C#_Windows Phone - Fatal编程技术网

C# items控件项不会在Windows Phone应用程序的ScrollViewer中呈现

C# items控件项不会在Windows Phone应用程序的ScrollViewer中呈现,c#,windows-phone,C#,Windows Phone,我正在尝试在Windows Phone应用程序中创建滚动页面。此页面包含一些静态内容,后面是items控件 <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ScrollViewer> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /&g

我正在尝试在Windows Phone应用程序中创建滚动页面。此页面包含一些静态内容,后面是items控件

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">            
  <ScrollViewer>
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition />
      </Grid.RowDefinitions>

      <TextBlock Text="Static text line 1" />
      <TextBlock Grid.Row="1" Text="Another lineof static text" />

      <ItemsControl Grid.Row="2" ItemsSource="{Binding Path=MyItems}" ItemTemplate="{StaticResource myTemplate}"></ItemsControl>
    </Grid>
  </ScrollViewer>
</Grid>

奇怪的是,当我使用这种方法时,ItemsControl项不会呈现。但是,如果我将ScrollViewer移动到静态文本项下面,并将ItemsControl放置在ScrollViewer中,则我的项呈现得很好


我做错了什么?我觉得一定有一些我忽略的小而不重要的东西。谢谢。

将行
替换为
。*表示它将占用所有可用空间。

第一个
TextBlock
ItemsControl
都将位于同一个网格行中,这意味着其中一个将覆盖另一个,但是我认为您无法看到的是
TextBlock
。我错过了网格.row定义。现在就到了。不过我同意你的评估。不过,我的物品没有显示出来。