JumpList.JumpItems 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取跳转列表中显示的对象集合 JumpItem 。
public:
property System::Collections::Generic::List<System::Windows::Shell::JumpItem ^> ^ JumpItems { System::Collections::Generic::List<System::Windows::Shell::JumpItem ^> ^ get(); };
public System.Collections.Generic.List<System.Windows.Shell.JumpItem> JumpItems { get; }
member this.JumpItems : System.Collections.Generic.List<System.Windows.Shell.JumpItem>
Public ReadOnly Property JumpItems As List(Of JumpItem)
属性值
跳转列表中显示的对象集合 JumpItem 。 默认值为空集合。
示例
以下示例演示如何获取集合的JumpList当前JumpItems和清除内容。 Apply然后调用该方法以将JumpList更改应用到 Windows shell。 此示例是类概述中提供的大型示例的 JumpList 一部分。
private void ClearJumpList(object sender, RoutedEventArgs e)
{
JumpList jumpList1 = JumpList.GetJumpList(App.Current);
jumpList1.JumpItems.Clear();
jumpList1.Apply();
}
注解
跳转列表可以包含两种类型的项:一 JumpTask 个和一个 JumpPath。 A JumpTask 是指向程序的链接, JumpPath 也是指向文件的链接。
创建集合 JumpList 时,集合 JumpItems 为空。 可以将任何 JumpTask 或 JumpPath 对象添加到集合。 集合将仅包含程序添加的项。 通过成功调用 JumpList 或 EndInit 方法将 Apply 传递给 Windows shell 后,JumpItems 集合将仅包含已成功添加到任务栏跳转列表中的项。 未成功添加的项将从 JumpItems 集合中删除。 可以通过事件处理程序 JumpItemsRejected 访问已删除项的列表以及 JumpItemsRemovedByUser 事件。