0

I am now studying the jump list feature and trying to implement it in my WPF/C# project.

I observed the following issues when executing the example from the MSDN link: https://docs.microsoft.com/en-us/dotnet/api/system.windows.shell.jumplist?view=net-5.0:

1). JumpList.GetJumpList(App.Current) always returns a newly created one.

That's to say, all the added items are lost after the program is restarted;

2). The strange thing is: if we right-click the program on the taskbar, the added items are already there. However, after we add one item by clicking the following button, the added items are gone;

<Button Content="Add Task to JumpList" Click="AddTask" />

I think the root cause lies in #1), namely, though we could see the added items in #2), they don't appear in the returned value from JumpList.GetJumpList. As a result, all those items added in the previous launching are lost after we add one.

To confirm #1), I did a test by removing the <JumpList.JumpList> section in the App.xaml, and found each time when the program is launched, JumpList.GetJumpList always returned null.

My question is: How could we get those added items in code? Namely, I want to get those items shown in #2).

I DID searched a lot but failed to get useful info to solve my question. And looks there have similar questions but still kept open without proper answer. For example: How to get the recent items from the JumpList?

In fact I have a final solution: Save the added items in a configuration/preference file, and update the file if the item is removed from code logic. And this is the last step that I have to take if no other solution.

Please give me any hint if you have.

Thanks very much!

Bo Liu
  • 23
  • 4
  • The correct approach would be to add [bounty](https://stackoverflow.com/help/bounty) to such question, to motivate exports to do research and/or share their knowledge. The answer is not there because maybe there is no answer. – Sinatr Nov 26 '20 at 14:43
  • @Sinatr thank you for the comment. It could be great to be more specific for your suggestion on the bounty to my question? I agree that the similar questions are not very popular like others such as C++ or C# grammar details as I didn't see a complete working example so far. – Bo Liu Nov 27 '20 at 00:02

0 Answers0