Windows Store 应用相当于调用 Windows Store Phone 应用中的 StatusBar?

What is the Windows Store app equivalent of the StatusBar in Windows Store Phone Apps called?

在 Windows 商店 Phone 应用程序的顶部有一个名为状态栏的栏,可在代码 @ Windows.UI.ViewManagement.StatusBar 中访问。 this Windows Phone 应用商店应用的介绍中对其进行了有用的标记。

Windows 商店应用程序(即您 运行 在桌面 PC 上使用的应用程序)顶部有一个栏,仅当您将鼠标悬停在应用商店顶部附近时才会显示屏幕。 Here 是它的图片,它是图片最顶部的黑条。

那个黑条叫什么? Windows.UI 库中存储的组件在哪里?我正在寻找 Windows.UI.ViewManagement.StatusBar 的等价物,但我一直没有找到它,因为我不知道它叫什么。

它被称为标题栏,它是 Windows 的一部分,因为可能是第一个版本,它不是 Metro 特定的。它在 8.1 中被添加到 Metro 应用程序中,以方便用户关闭应用程序。您无法从代码访问它,没有 API.

对于 Windows 8.1 及以下版本,没有 API。

但是,Windows 10 将为标题栏引入一个 API,as described and explored。 Tweetium 和 VLC 已在其应用程序中提供此功能。

虽然 W10 APIs 尚未发布,但从上面的站点中,这里有一些您已经可以使用的代码:

var v = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
var allProperties = v.GetType().GetRuntimeProperties();
var titleBar = allProperties.FirstOrDefault(x => x.Name == "TitleBar");
if (titleBar == null) return;
dynamic titleBarInst = titleBar.GetMethod.Invoke(v, null);
titleBarInst.BackgroundColor = Colors.CornflowerBlue;
titleBarInst.ForegroundColor = Colors.Red;
titleBarInst.ButtonBackgroundColor = Colors.DimGray;
titleBarInst.ButtonForegroundColor = Colors.Orange;

所以对于 Win 10 APIs(尚未发布!),以下代码应该是可能的:

var v = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();        
v.TitleBar.BackgroundColor = Colors.CornflowerBlue;
v.TitleBar.ForegroundColor = Colors.Red;
v.TitleBar.ButtonBackgroundColor = Colors.DimGray;
v.TitleBar.ButtonForegroundColor = Colors.Orange;