JumpList.Apply Method

Definition

在其当前状态下将 JumpList 发送到 Windows shell 中。Sends the JumpList to the Windows shell in its current state.

public:
 void Apply();
public void Apply ();
[System.Security.SecurityCritical]
public void Apply ();
member this.Apply : unit -> unit
Public Sub Apply ()
Attributes

Exceptions

JumpList 未完全初始化。The JumpList is not completely initialized.

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

Apply 方法将 JumpList 的内容发送到 Windows shell 的当前状态。The Apply method sends the content of the JumpList to the Windows shell in its current state. 完成此调用后,将修改 JumpItems 属性,使其只包含 Windows shell 成功添加到其任务栏跳转列表中的那些项。After this call is complete, the JumpItems property is modified to contain only those items that the Windows shell successfully added to its taskbar Jump List. 可以通过事件处理程序为 JumpItemsRejectedJumpItemsRemovedByUser 事件访问已删除项的列表。You can access the lists of removed items through event handlers for the JumpItemsRejected and JumpItemsRemovedByUser events.

Applies to