我正在尝试在我的 Metro 应用程序中使用 AppBar。问题是,我还有一些 WebView 正在 AppBar 上显示。这是我的代码:
<Page
x:Class="AppName.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppName"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="#00D4FF" Canvas.ZIndex="1">
<WebView Source="http://bing.com/"
VerticalAlignment="Center" Margin="306,518,360,25"
Canvas.ZIndex="1" Height="225" />
</Grid>
<Page.BottomAppBar>
<AppBar x:Name="ABar" IsSticky="True" Padding="10,0,10,0" Canvas.ZIndex="200">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource EditAppBarButtonStyle}" x:Name="EditButton" Visibility="Collapsed" />
<Button Style="{StaticResource AddAppBarButtonStyle}" />
<Button Style="{StaticResource DeleteAppBarButtonStyle}" x:Name="DelButton" Visibility="Collapsed" />
</StackPanel>
</Grid>
</AppBar>
</Page.BottomAppBar>
如果您运行它并调出 appbar,您会注意到 WebView 显示在 appbar 上方,即使 AppBar 的 Canvas.ZIndex 高于 WebView 和 Grid 的 ZIndex。我该如何防止这种情况发生?