.NET Framework Class Library
JumpList Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a list of items and tasks displayed as a menu on a Windows 7 taskbar button.

Namespace:  System.Windows.Shell
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: Not mapped to an xmlns.
Syntax

Visual Basic (Declaration)
<ContentPropertyAttribute("JumpItems")> _
<UIPermissionAttribute(SecurityAction.LinkDemand, Window := UIPermissionWindow.AllWindows)> _
Public NotInheritable Class JumpList _
    Implements ISupportInitialize
Visual Basic (Usage)
Dim instance As JumpList
C#
[ContentPropertyAttribute("JumpItems")]
[UIPermissionAttribute(SecurityAction.LinkDemand, Window = UIPermissionWindow.AllWindows)]
public sealed class JumpList : ISupportInitialize
Visual C++
[ContentPropertyAttribute(L"JumpItems")]
[UIPermissionAttribute(SecurityAction::LinkDemand, Window = UIPermissionWindow::AllWindows)]
public ref class JumpList sealed : ISupportInitialize
F#
[<SealedAttribute>]
[<ContentPropertyAttribute("JumpItems")>]
[<UIPermissionAttribute(SecurityAction.LinkDemand, Window = UIPermissionWindow.AllWindows)>]
type JumpList =  
    class
        interface ISupportInitialize
    end
XAML Object Element Usage
<JumpList>
  JumpItems
</JumpList>
Remarks

The Windows 7 taskbar provides enhanced functionality for launching programs directly from the taskbar button through the use of Jump Lists. The JumpList class provides a managed wrapper for the Jump List functionality in the Windows 7 taskbar and manages the data passed to the Windows shell. The functionality exposed by JumpList is not available in versions of Windows prior to Windows 7.

Jump Lists can contain two types of items, a JumpTask and a JumpPath. A JumpTask is a link to a program and a JumpPath is a link to a file. You can add these items to a CustomCategory or display the standard Recent and Frequent categories that are managed by the Windows shell. You must apply the JumpList to the Windows shell before its contents are available in the taskbar Jump List. You can call the Apply method to send the contents of a JumpList to the Windows shell in its current state.

A JumpList does not automatically have affinity to an Application object. You attach a JumpList to an Application object in code by calling the static SetJumpList method. This also applies the JumpList to the Windows shell. You attach a JumpList to an Application object in XAML by using the attached property syntax. The JumpList class implements the ISupportInitialize interface to support XAML declaration of a JumpList. If the JumpList is declared in XAML and attached to the current Application, it is applied to the Windows shell in the call to the EndInit method when the JumpList is initialized.

You can create multiple JumpList objects. Only one JumpList at a time can be applied to the Windows shell, and only one JumpList at a time can be attached to an Application. However, these do not need to be the same JumpList. You can call the GetJumpList method to get the JumpList currently associated with an Application, which might not be the JumpList currently applied to the Windows shell. Your application cannot query the contents of the Jump List as it exists in the Windows shell.

NoteNote

This class contains a link demand at the class level that applies to all members. A SecurityException is thrown when the immediate caller does not have full-trust permission. For more information about security demands, see Link Demands and Inheritance Demands.

Examples

The following example shows how to declare a JumpList in markup. The JumpList contains two JumpTask links and one JumpPath. Applying the JumpPath to the shell will fail if the application is not registered to handle the .txt file extension.

XAML
<Application x:Class="JumpListSample.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <JumpList.JumpList>
        <JumpList ShowRecentCategory="True"
                  ShowFrequentCategory="True"
                  JumpItemsRejected="JumpList_JumpItemsRejected"
                  JumpItemsRemovedByUser="JumpList_JumpItemsRemovedByUser">
            <JumpTask Title="Notepad" 
                      Description="Open Notepad." 
                      ApplicationPath="C:\Windows\notepad.exe"
                      IconResourcePath="C:\Windows\notepad.exe"/>
            <JumpTask Title="Read Me" 
                      Description="Open read me in Notepad." 
                      ApplicationPath="C:\Windows\notepad.exe"
                      IconResourcePath="C:\Windows\notepad.exe"
                      WorkingDirectory="C:\Users\Public\Documents"
                      Arguments="readme.txt"/>
            <JumpPath Path="C:\Users\Public\Documents\readme.txt" />
        </JumpList>
    </JumpList.JumpList>
</Application>

The following example shows how to create a JumpList in procedural code. The static SetJumpList()()() method is called to associate the JumpList with the current application and apply the JumpList to the Windows shell.

C#
private void SetNewJumpList(object sender, RoutedEventArgs e)
{
    //Configure a JumpTask
    JumpTask jumpTask1 = new JumpTask();
    jumpTask1.ApplicationPath = "C:\\Windows\\write.exe";
    jumpTask1.IconResourcePath = "C:\\Windows\\write.exe";
    jumpTask1.Title = "WordPad";
    jumpTask1.Description = "Open WordPad.";
    jumpTask1.CustomCategory = "Jump List 2";
    // Set the JumpList.
    JumpList jumpList2 = new JumpList();
    jumpList2.JumpItems.Add(jumpTask1);
    JumpList.SetJumpList(App.Current, jumpList2);
}
.NET Framework Security

Inheritance Hierarchy

System..::.Object
  System.Windows.Shell..::.JumpList
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4
See Also

Reference

Page view tracker