2

我用 JavaScript 编写 Windows 10 应用程序并且知道存在一些限制。如果我查看jumplists 的文档,Microsoft 只写了»有关创建或访问此对象的信息,请参阅备注。« 对于 JavaScript,仅提供 C# 示例。

那么如何将跳转列表添加到我的 UWP Windows 10 应用程序以及如何添加和删除列表项?

4

1 回答 1

2

它与 c# 代码非常相似。

你可以在这里找到一个例子: https ://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/JumpList/js/js

基本代码是:

var Uri = Windows.Foundation.Uri;
var StartScreen = Windows.UI.StartScreen;
var JumpList = StartScreen.JumpList;
var JumpListItem = StartScreen.JumpListItem;

var item = JumpListItem.createWithArguments("key", "caption");
item.description = "Description";
item.groupName = GroupName.value;
item.logo = new Uri("ms-appx:///images/your-images.png");
jumpList.items.append(item);

jumpList.saveAsync();
于 2016-06-15T08:57:13.773 回答