我用 JavaScript 编写 Windows 10 应用程序并且知道,有一些限制。如果我看 documentation for jumplists , Microsoft 只是写了»有关创建或访问此对象的信息,请参阅备注。« 对于 JavaScript,并且仅给出 C# 的示例。
那么如何向我的 UWP Windows 10 应用添加跳转列表以及如何添加和删除列表项?
最佳答案
它与 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();
关于javascript - 如何将跳转列表添加到 UWP Windows 10 应用程序——用 JavaScript 编写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37829774/