I had develop an Wpf application which open an .doc file and doing some operations. Now I want to add open recent feature in menu items which shows the list of recently opened document. Now there is a wpf class called jump list but I do not understand how to use the jump list in my application.
How to add recently open documents to the OpenRecent menu items in WPF
Jump Lists are available from the task bar. This is what you need ? –
Strikebreaker
yes...How do I use the Jump Lists. –
Selfinsurance
You can use the ShowRecentCategory property of the JumpList. When you start the app create the jump list:
JumpList jumpList = new JumpList();
jumpList.ShowRecentCategory = true;
JumpList.SetJumpList(Application.Current, jumpList);
Then when you want to add a document to the recent list use the AddToRecentCategory method:
JumpList.AddToRecentCategory(/*item path*/);
Important to rememer: "If your application is not registered to handle the file type of the item, it will not appear in the Recent list and calls to AddToRecentCategory(String) will fail silently."
© 2022 - 2024 — McMap. All rights reserved.