Windows 个应用中的重叠视图

Overlapping views in Windows apps

我想为我的应用实现以下页面

所以我使用了类似(简化)的东西:

<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <TextBlock>...</TextBlock>
    <ListView>...</ListView>
    <TextBlock>...</TextBlock>
</Grid>

如果发生错误并且数据不可用,我想在页面背景中显示错误而不阻止用户交互。类似于:

我用堆栈面板实现了错误

如何重叠 ListView 和堆栈面板?让堆栈面板在列表视图房间居中?

我试过 Canvas 但不知道如何使视图居中

<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <TextBlock>...</TextBlock>
    <Canvas>
       <StackPanel>..</StackPanel>
       <ListView>...</ListView>
    </Canvas>
    <TextBlock>...</TextBlock>
</Grid>

尝试在页面内容上显示弹出窗口(在与 LayoutRoot 相同的容器上)

   <Grid>
      <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock>...</TextBlock>
        <TextBlock>...</TextBlock>
       </Grid>
       <Grid x:Name="PopUpGrid" Width="200" Height="200" 
             VerticalAllignment="Center" HorizontalAllignment="Center">
       ....
       </Grid>
   </Grid>