Loading multiple images

Nov 21, 2011 at 11:31 PM

Our object model contains logical groups of image files (single and multi-page pdfs & tiffs) that we need to view together.  So the PageNavigator or ThumbnailListBox would show the full collection of all pages in all of the files to allow users to navigate through them seamlessly.  I'm looking for suggestions on how to achieve that.  It looks like a custom implementation of IPackageReader could manage multiple files or URIs.  I don't know how the DomainDataSource requests data though.

Coordinator
Nov 22, 2011 at 11:14 AM

That's correct, a custom IPackageReader implementation enables your scenario.

You should derive you package reader from MemoryPackageReader (in FirstFloor.Documents.IO), which is an implementation of IPackageReader. The MemoryPackageReader class provides the base functionality of a reader where the package contents are built dynamically in memory. This class is also used by the TiffPackageReader for showing multiple image frames of a single TIFF image. See http://documenttoolkit.codeplex.com/SourceControl/changeset/view/80956#1905208 for the source code.

With the MemoryPackageReader you essentially build an XPS document on the fly. You need to return page XAML and image streams based on requests that are performed by the DocumentDataSource.

Let me know if you need more help.

- Koen