Windows Universal APP - 全屏窗口标题栏

时间:2015-07-14 09:46:43

标签: windows-runtime winrt-xaml win-universal-app

我正在开发一个C#/ XAML Windows 10 Universal App(根据我的理解,这实际上是WinRt平台)。现在我关注桌面运行时环境 - 即使我的应用程序处于全屏模式,当我将鼠标指针移动到屏幕应用程序的顶部时,会出现一个标准窗口标题栏。这种行为很烦人,因为与我的UI设计不一致,是否可以改变这种行为?

2 个答案:

答案 0 :(得分:1)

不能禁用它,但它只会在您处于桌面模式(使用鼠标)时显示。另一方面,当您处于移动模式(使用触摸模式)时,标题栏将不会显示。之所以存在,是因为很多老鼠都抱怨没有任何简单的方法来最小化或关闭应用程序。

如果你觉得它很烦人并且与你的设计不符,不幸的是你可能不得不改变你的设计。

答案 1 :(得分:0)

我找到了一种解决方法,几乎​​可以让我实现我想要的效果 - 将应用程序的默认样式标题栏更改为透明。在这样做之后,当用户将鼠标滑动到应用程序的上边缘时,只有像素粗蓝线的东西将在上边缘上方。

CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
var view = ApplicationView.GetForCurrentView();
var titleBar = view.TitleBar;

titleBar.BackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.InactiveBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.InactiveForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonHoverBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonPressedBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0,   0);
titleBar.ButtonInactiveBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonHoverForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonPressedForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
titleBar.ButtonInactiveForegroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);

现在,有趣的问题是如何通过任务栏实现类似效果。