Question Populate PDFs into a WPF application ?

Kuhnhound

New member
Joined
Dec 12, 2013
Messages
2
Programming Experience
Beginner
I'm fairly new to Visual Studio, so please excuse the lack of technical terminology or specifics in this post. I do have a few Windows Forms apps under my belt. I'm moving on to doing a WPF Application now and am hitting a wall. My goal is to
make an interactive catalog for our company where the user can select a specific vendor from a TreeView and in a different spot on the app, it'll display the available PDF catalogs that they can then open for that particular vendor.

Basically what i'm looking for is a way for the app to look into an external folder and display in the app which PDF files are in that folder, then allow the user to open these PDFs from within the application. Is this possible? If so, any ideas on how to do it? Again, i'm an extreme newbie that learns best by tinkering and piecing bits and pieces together as I learn.

Any input would be greatly appreciated!

 
Working with the file system is basically the same in WPF as it is in WinForms because it's not a UI issue. Look at the System.IO namespace and, in particular, the File, Directory, FileInfo and DirectoryInfo types.

As for opening the files, do you mean that the PDF contents will be displayed within your own window or in the user's default PDF application?
 
I would just want the PDF to open with the user's default PDF application. In a perfect world I'd like to be able to just go into the folders I designate for the different vendor PDF files and add and delete them as new ones become available, that way when the catalog app launches, it is populated with the current PDFs in the folder, without having me go in and change code.

Is there a certain type of control that I could use to make displaying the PDFs any easier? Again, sorry if i'm retreading here, still trying to learn.
 
Is there a certain type of control that I could use to make displaying the PDFs any easier?

That's just too vague a question to be able to answer. In the end, what you will be displaying in a list is just text, so any control that can display text will work. It really depends what you want it to look like. The simplest option that I can think of is to bind an array of FileInfo objects to a ListBox, but I don't know if that will fit your needs.

You might also look at the FileSystemWatcher as a way to receive notifications when folders change rather than having to poll.
 
Back
Top