UWP创建平铺菜单链接

时间:2018-03-07 13:08:02

标签: c# uwp deep-linking windows-community-toolkit

我想在Tile菜单上为我的UWP应用程序提供一些针对我应用程序中特定内容的深层链接。

基本上我想像XBOX应用程序一样 Xbox tile menu

如何创建这些链接?

2 个答案:

答案 0 :(得分:1)

这称为跳转列表,请点击此处了解详情:https://docs.microsoft.com/en-us/uwp/api/windows.ui.startscreen.jumplist

答案 1 :(得分:0)

您可以使用Windows.UI.StartScreen.JumpList类型访问应用跳转列表的feautres。然后,这些操作将出现在“开始”菜单和“任务栏”中。

使用SystemGroupKind属性,您可以指定应在跳转列表的系统区域中显示的内容 - 最近打开的文件为Recent,频繁打开的项目为Frequent或{{ 1}}什么也没有。要使此区域处于活动状态,您需要为您的应用程序使用文件类型关联。

然后,对于您自己的自定义项目,您可以使用None属性,只需添加新链接即可 -

Items

当用户点击任务时,您可以使用// Create JumpListItem - first parameter is the activation argument, // second the title of the task var taskItem = JumpListItem.CreateWithArguments( "/Argument", "Write message"); // Set the description (optional) taskItem.Description = "Write a message to someone."; // Set the icon, URI must be ms-appx: or ms-appdata: taskItem.Logo = new Uri("ms-appx:///Assets/WriteMessage.png"); // You may also specify a GroupName to group the tasks return taskItem; App.xaml.cs方法检查参数:

OnLaunched