JumpList.JumpItems Property

Definition

获取在跳转列表中显示的 JumpItem 对象的集合。Gets the collection of JumpItem objects that are displayed in the Jump List.

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)

Property Value

List<JumpItem>

在跳转列表中显示的 JumpItem 对象的集合。The collection of JumpItem objects displayed in the Jump List. 默认值为空集合。The default is an empty collection.

Examples

下面的示例演示如何获取当前 JumpList 并清除 JumpItems 集合的内容。The following example shows how to get the current JumpList and clear the contents of the JumpItems collection. 然后调用 Apply 方法,将 JumpList 更改应用于 Windows shell。The Apply method is then called to apply the JumpList changes to the Windows shell. 此示例是 JumpList 类概述中提供的一个更大示例的一部分。This example is part of a larger example available in the JumpList class overview.

private void ClearJumpList(object sender, RoutedEventArgs e)
{
    JumpList jumpList1 = JumpList.GetJumpList(App.Current);
    jumpList1.JumpItems.Clear();
    jumpList1.Apply();
}

Remarks

跳转列表可以包含两种类型的项: JumpTaskJumpPathJump Lists can contain two types of items, a JumpTask and a JumpPath. JumpTask 是指向程序的链接,JumpPath 是指向文件的链接。A JumpTask is a link to a program and a JumpPath is a link to a file.

创建 JumpList 时,JumpItems 集合为空。When a JumpList is created, the JumpItems collection is empty. 可以将任何 JumpTaskJumpPath 对象添加到集合中。You can add any JumpTask or JumpPath objects to the collection. 集合将只包含程序添加的项。The collection will only contain items that have been added by your program. 通过成功调用 EndInitApply 方法将 JumpList 传递到 Windows shell 后,JumpItems 集合将仅包含已成功添加到任务栏跳转列表中的项。After the JumpList has been passed to the Windows shell by a successful call to either the EndInit or Apply methods, the JumpItems collection will contain only the items that were successfully added to the taskbar Jump List. 将从 JumpItems 集合中删除未成功添加的项。Items that were not successfully added are removed from the JumpItems collection. 可以通过事件处理程序为 JumpItemsRejectedJumpItemsRemovedByUser 事件访问已删除项的列表。You can access the lists of removed items through event handlers for the JumpItemsRejected and JumpItemsRemovedByUser events.

Applies to