Hello,
I would like to print the xamNetworkNode. I do not want to use PrintVisual. Is there anyway i could create a flow document and print that?
Thanks
Rohit
Hi Rohit,
I've looked into your requirements and I believe you should be able to use a FlowDocument where you can embed the XamNetworkNode control and then print the flow document with the PrintDialog.PrintDocument method. In order to embed the XamNetworkNode within a FlowDocument you will need to contain it within a BlockUIContainer.
I tried to create the flow document as you suggested:
FlowDocument
fDoc = new FlowDocument();
BlockUIContainer bContainer = new BlockUIContainer();
XamNetworkNode Temp = new XamNetworkNode();
Temp.NodeDistance = InNodeDistance;
Temp.SelectionType =
NetworkNodeSelectionType.Single;
Temp.ItemsSource = NetworkNodes;
bContainer.Child = Temp;
fDoc.Blocks.Add(bContainer);
For printing i used steps in the following link:
http://roecode.wordpress.com/2007/12/21/using-flowdocument-xaml-to-print-xps-documents/
It printed a blank page. Could you please tell me what am i doing wrong here?