title: Saving a wpf layout to pdf using pdfsharp, c#
body: <p>I'm new to c#, wpf and the pdfsharp library. 
  This is my XAML Code: </p>
  
  <pre><code>&lt;Grid&gt;
      &lt;zoom:ZoomControl&gt;
      &lt;graphsharp:GraphLayout x:Name="graphLayout"
                              Graph="{Binding ElementName=root, Path=GraphToVisualize}" 
                              LayoutAlgorithmType="FR"
                              OverlapRemovalAlgorithmType="FSA"
                              HighlightAlgorithmType="Simple"&gt;&lt;/graphsharp:GraphLayout&gt;
      &lt;/zoom:ZoomControl&gt;
      &lt;Button Content="Button" Height="23" Name="button1" Width="75" Margin="12,294,658,412" Click="button1_Click" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>I want now save my "graphLayout" to a pdf-file using Pdfsharp. I created a button and used basically the "hello world" sample code in the pdfsharp wiki to start. </p>
  
  <pre><code>PdfDocument document = new PdfDocument();
          document.Info.Title = "Created with PDFsharp";
          PdfPage page = document.AddPage(); 
          XGraphics gfx = XGraphics.FromPdfPage(page);
          XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
          gfx.DrawString("My Graph", font, XBrushes.Black,
              new XRect(0, 0, page.Width, page.Height),
              XStringFormats.TopCenter);
          const string filename = "MyGraph.pdf";
          document.Save(graphLayout+filename);
          Process.Start(filename);
  </code></pre>
  
  <p>I get a pdf , but there is just the text in it. Can somebody tell me please, how i can save the whole layout into a pdf?
  thanks</p>