Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Recent Documents History in C# in WPF Application

I am making a WPF Application in C# where I need to show the recent documents history (just like it happens in word, excel and even visual studio), showing the list the last 5 or 10 documents opened. I have absolutely no idea as to how I should go about it. Please help. And please be kind and gentle...I am an amatuer coder, and it is tough to digest high-tech talks as of now! :)

like image 443
Gagan Avatar asked Mar 08 '10 07:03

Gagan


People also ask

How do I see most recent files on C drive?

Press the Windows key + E on the keyboard to open File Explorer. On the left side-scrolling menu, select the drive or folder that you want to view the last modified date(s) (A) for the contents.

How do I show more recent documents?

Right click the Start Button and click Properties. Select the Customize Button. At the bottom of that configuration dialog you will see the settings for increasing the number of recent items in the Jump Lists.

Can you see when a file was last opened?

Right click on the files/folders select Properties. Select the Security tab. Click the Advanced button. Select the Audit tab.


2 Answers

JumpList in WPF4 is awesome. This was all I needed to do:

<Application 
    x:Class="MyApp"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    <Application.Resources>
    </Application.Resources>
    <JumpList.JumpList>
        <JumpList ShowRecentCategory="True"/>
    </JumpList.JumpList>
</Application>
like image 186
Sergey Aldoukhov Avatar answered Sep 30 '22 19:09

Sergey Aldoukhov


My idea of solving this problem (as a beginner) was to retain all the file paths into a Queue of given maximum capacity and adding them at run-time into a menuItem...

like image 23
Andrei Ciobanu Avatar answered Sep 30 '22 18:09

Andrei Ciobanu