JumpList.GetJumpList does not contain recent items

So my WPF application has a navigation list defined in App.xaml

<JumpList.JumpList>
    <JumpList ShowRecentCategory="True"/>
</JumpList.JumpList>

      

This list is empty unless windows recognizes certain files associated with my application. I was able to link the extension of my custom file using Inno Setup and the jump list shows up nicely in the win7 + launcher menu + taskbar. Clicking on such "last file" invokes my application with an additional command line argument (filename), and I can open that file directly when the application starts.

Purpose: Show the latest files inside the application (not just on the win7 taskbar). Think of the File menu (for example, Visual Studio: File> Recent Files ...) or something like a start page that lists the latest projects to go to.

Problem: JumpList only contains custom tasks, not recent files. You can iterate over JumpItems via

List<JumpItem> items = JumpList.GetJumpList(Application.Current).JumpItems

      

which is a list of JumpTask / JumpPath instances. This is where I find specially crafted tasks (for example if I define one in App.xaml

) but not the latest files that appear in windows (start menu / taskbar). So in my case the windows show the 10 most recent files, but in the application I can't find a way to display them.

If I omit the definition of JumpList from App.xaml

, then the above call returns null instead of JumpList (thought I overwritten winList win7, but no).

+3


source to share


1 answer


You need to manually add the last element to the jumplist



var jumpTask = new JumpTask
{
    Title = fileName,
    Arguments = fullPath
};
JumpList.AddToRecentCategory(jumpTask)

      

0


source







All Articles