Xaml 在视图中的其他控件(ZIndex)顶部显示进度环

Xaml 在视图中的其他控件(ZIndex)顶部显示进度环,xaml,uwp,Xaml,Uwp,我正在制作一个UWP,并且我的视图中已经有了一个ListView。当我单击一个ListViewItem时,我会调用一个API,然后导航到另一个页面,传递被调用API的响应。我想做的是,在调用API时,我想显示一个进度环(直到出现导航) 这是我现在的XAML: <Grid> <ProgressRing Name="MyProgressRing" Grid.Row="0" Height="100" Width="100" Foreground="Red" IsActive=

我正在制作一个UWP,并且我的视图中已经有了一个
ListView
。当我单击一个
ListViewItem
时,我会调用一个API,然后导航到另一个页面,传递被调用API的响应。我想做的是,在调用API时,我想显示一个进度环(直到出现导航)

这是我现在的XAML:

<Grid>
    <ProgressRing Name="MyProgressRing" Grid.Row="0" Height="100" Width="100" Foreground="Red" IsActive="True" Visibility="Visible" />
            <ListView   Name="SearchResultListView"
                        SelectionMode="Single"
                        IsItemClickEnabled="True"
                        ItemClick="SearchResultListView_ItemClick">

                <ListView.ItemContainerStyle>
                    <Style TargetType="ListViewItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListView.ItemContainerStyle>

                <ListView.ItemTemplate>
                    <DataTemplate x:DataType="ViewModel:SearchResultViewModel">

                        <Grid Style="{StaticResource SearchResultListViewStyle}">
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>

                            <StackPanel Grid.Row="0">
                                <TextBlock Text="{x:Bind Name}"
                                    Grid.Row="0"/>
                            </StackPanel>

                            <TextBlock Text="{x:Bind Source}"
                                    Grid.Row="1"/>

                            <TextBlock Text="{x:Bind Author}"
                                    Grid.Row="2"/>

                            <TextBlock Text="{x:Bind EducationalLevel}"
                                    Grid.Row="3"/>

                            <StackPanel Orientation="Horizontal"
                                        Grid.Row="4">
                                <Border Background="Gray"
                                        Padding="3"
                                        CornerRadius="1">
                                    <TextBlock Text="{x:Bind Language}"
                                                FontSize="12"
                                                Margin="0, 0, 0, 2"/>
                                </Border>
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
    <RelativePanel>

        <Button Name="FilterButton"
                Foreground="Red"
                Width="85"
                Height="85" 
                BorderBrush="Blue"
                RelativePanel.AlignRightWithPanel="True"
                RelativePanel.AlignBottomWithPanel="True"
                Margin="0, 0, 40, 30"
                Style="{StaticResource CircleButtonStyle}"
                Click="FilterButton_Click">
            <Grid Width="60"
                    Height="60">
                <Ellipse Height="60" Width="60">
                    <Ellipse.Fill>
                        <ImageBrush ImageSource="/Assets/LandingPageLogos/LearningResourceTypeList/Article.png"/>
                    </Ellipse.Fill>
                </Ellipse>
            </Grid>
        </Button>

    </RelativePanel>
</Grid>


我希望我的<代码> PrassSrime<代码>在这个代码> ListVIEW/COD>之上,在这个页面的中间,当我做出<代码> MyPrimeRest.Ic能能能行=能见度。 例如:

<Grid>
    <Grid>
    <!-- your content here -->
    </Grid>

    <ProgressRing Name="MyProgressRing" Grid.Row="0" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Foreground="Red" IsActive="True" Visibility="Visible" />
</Grid>

您可以右键单击控件,转到
订单
并选择
带到前面


@AVK和@Andrii Krupka有一个很好的方法

但我想你可以设置Zindex来显示进度环

代码如下:

<ProgressRing Name="MyProgressRing" Grid.Row="0" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Foreground="Red" IsActive="True" Visibility="Visible" Canvas.ZIndex="10000000" />
   MyProgressRing.SetValue(Canvas.ZIndexProperty,int.MaxValue);