Search
Multiple Diagram Pages

The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. New pages can be added to the document and existing pages can be removed and reordered via the Pages collection. The SaveToXml and SaveToJson methods of DiagramDocument save all pages in a single file, and respectively the LoadFromXml and LoadFromJson methods load all pages from the file. DiagramDocument can also load files created by the serialization methods of Diagram, and will show them in a single page. Note that the opposite is not true: Diagram cannot load directly a DiagramDocument file.

DiagramPage is derived from Diagram and only adds a Title property, so any code that processes Diagram objects will work with DiagramPage objects too. A diagram document forwards each event raised by its pages, giving you a chance to use the same handler for events raised by different pages. If a page should implement distinct user interaction or validation logic, it is also possible to attach handlers to the Diagram events inherited by DiagramPage.

A DiagramDocument can be exported to PDF and Visio, and imported from Visio using the new overloads available in the PdfExporter, VisioExporter and VisioImporter classes respectively. Other export classes do not support multi-page export at this time, but still can be used to export individual pages via their Export(Diagram) method.

A single DiagramPage could be assigned to the Diagram property of DiagramView, and that lets you create your own user interface for presenting a list of pages to the user and selecting a current page.