0

我正在尝试创建一个停靠在桌面顶部的应用栏,例如任务栏。

但是现在,当一个程序全屏显示时,要么该程序遮住了我的 appbar,要么 appbar 遮住了想要全屏显示的程序的一部分。

有没有办法强制全屏程序避免使用屏幕的某些区域,这样我就可以同时看到应用栏和所有程序窗口?

4

1 回答 1

0

不知道你可以去哪里,或者确实是你要找的东西,但是......

带有主网格->

<Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootStyle}">
    <Grid.Background>
        <ImageBrush x:Name="MyImage" ImageSource="Assets/Screenshot (1).png" Stretch="UniformToFill"/>
    </Grid.Background>

还有一个 AppBar(这个在底部)->

<Page.BottomAppBar>
    <AppBar x:Name="bottomAppBar" Padding="10,0,10,0" Opened="bottomAppBar_Opened" Closed="bottomAppBar_Closed">
        <Grid>

在后面的代码中->

private void bottomAppBar_Opened(object sender, object e)
    {
       this.LayoutRoot.Margin = new Thickness(0,0,0,90);
       this.MyImage.Stretch = Stretch.Fill;
    }

    private void bottomAppBar_Closed(object sender, object e)
    {
        this.LayoutRoot.Margin = new Thickness(0, 0, 0, 0);
    }

它将主页面挤压到 appBar 之外。

只是玩得开心尝试...

于 2012-08-12T21:29:39.343 回答