Windows 8.1 应用向上滑动打开应用栏,向上滑动关闭应用栏 - 这是默认行为吗?

Windows 8.1 app swipe up opens appbar and swip up closes appbar - is this default behavior?

我在 Windows 8.1 应用程序中有一个底部 appBar。 当我向上滑动时,底部的 appBar 打开。好的。 如果我向下滑动到底部的 appBar,什么也不会发生。不好。 如果我再次向上滑动,底部的 appBar 将关闭。不好。

我希望它向上滑动 = 打开底部 AppBar 向下滑动 = 关闭底部 AppBar。

我在 AppBar 上放置了一个事件处理程序,在 appBar 中放置了 Grid 以捕获指针输入事件,但我很确定这不是控制它的正确方法。

可能是罪魁祸首的一件事是我们设置了 IsSticky = true 因为我们只想在屏幕底部边缘滑动。

我在这里放了一个行为视频:Click here for video of behavior

有没有办法通过 isSticky=true 来控制向上滑动 = 打开和向下滑动 = 关闭?

谢谢!

是的,这是默认行为。默认情况下,当用户在应用栏之外的任何地方与您的应用交互时,应用栏将被关闭。这称为轻解雇。要使命令可见,您可以通过将 IsSticky 属性 设置为 true 来更改关闭模式。当应用栏是粘性的时,只有当用户右键单击、按 Windows+Z 或从屏幕的顶部或底部边缘滑动时,它才会消失。

例如:

<AppBar IsSticky="True">
<Grid>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <Button Style="{StaticResource HelpAppBarButtonStyle}" 
            Click="Button_Click"/>
    </StackPanel>
</Grid>
</AppBar>

应用栏可以由用户通过边缘滑动来关闭。应用栏自动响应边缘滑动。因此无法在向下滑动时关闭应用栏,因此您必须根据需要以编程方式执行此操作。