This project is read-only.

Loading multiple images

Nov 22, 2011 at 12:31 AM

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.

Nov 22, 2011 at 12:14 PM

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 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