Multiple WPFPreviewHandlers in One Window? Can it be done?

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-04-22T16:09:31Z Indexed on 2010/04/22 16:13 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

Here is the scenario. I am building a part of my desktop app up and I have a need to create a preview handler. I found plenty of examples on the web of a WPF Preview handler, but I wanted to go one step more than just that. Lets say we have multiple documents and I wished to compare them. So the ideal scenario would be able to see documents side by side in a collection. Sort of how BING does their image search. But the more documents I select in a list box, the more documents I can compare all at once. The second Ideal solution would be a tabbed interface. One tab for each document. Sort of like how internet browsers are doing it now. Understand?

So here is the question that I have been struggling with. I can get one preview to work in a window, but can’t get the second one to show up. This is all WPF code so maybe im doing something wrong, but can you preview more than one document in a window at a time? My thought is no, because the previewhandler needs a window handler to lock onto.

I would love small code sample since COM and handlers aren’t my sort of thing, but I can manage if you are just able to point me down the right track.

Here is the code I found for the WPF Handler. http://blogs.microsoft.co.il/blogs/tamir/archive/2008/04/18/using-vista-preview-handlers-in-wpf-application.aspx

© Stack Overflow or respective owner

Related posts about wpfpreviewhandlers

Related posts about wpf