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://learn.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!