Export (0) Print
Expand All

JumpList.GetJumpList Method

.NET Framework 4.6 and 4.5

Returns the JumpList object associated with an application.

Namespace:  System.Windows.Shell
Assembly:  PresentationFramework (in PresentationFramework.dll)

public static JumpList GetJumpList(
	Application application
)

Parameters

application
Type: System.Windows.Application

The application associated with the JumpList.

Return Value

Type: System.Windows.Shell.JumpList
The JumpList object associated with the specified application.

You can call the GetJumpList method to get the JumpList currently associated with an Application. The .NET Framework does not require that this be the JumpList that is currently applied to the Windows shell.

The following example shows how to get the JumpList associated with the current application. A JumpTask is added to the JumpItems collection and added to the Recent category. The Apply method is called to apply the updated JumpList to the Windows shell. This example is part of a larger example available in the JumpList class overview.

private void AddTask(object sender, RoutedEventArgs e)
{
    // Configure a new JumpTask.
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to Calculator and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.Title = "Calculator";
    jumpTask1.Description = "Open Calculator.";
    jumpTask1.CustomCategory = "User Added Tasks";
    // Get the JumpList from the application and update it.
    JumpList jumpList1 = JumpList.GetJumpList(App.Current);
    jumpList1.JumpItems.Add(jumpTask1);
    JumpList.AddToRecentCategory(jumpTask1);
    jumpList1.Apply();
}

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft