SerializerWriter.CreateVisualsCollator Method ()

 

When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements.

Namespace:   System.Windows.Documents.Serialization
Assembly:  PresentationFramework (in PresentationFramework.dll)

public abstract SerializerWriterCollator CreateVisualsCollator()

Return Value

Type: System.Windows.Documents.Serialization.SerializerWriterCollator

A SerializerWriterCollator that writes collated Visual elements to the document output serialization Stream.

Notes to Implementers:

CreateVisualsCollator should return a SerializerWriterCollator that writes to the same serialization Stream as the SerializerWriter that is used to create it.

The following example shows the use of the CreateVisualsCollator method.

private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
    // Setup for writing multiple visuals
    VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();

    // Iterate through all visuals in the collection
    foreach (Visual v in vc)
    {
        vToXpsD.Write(v);   //Write each visual to single page
    }

    // End writing multiple visuals
    vToXpsD.EndBatchWrite();
}

.NET Framework
Available since 3.0
Return to top
Show: