title: Userdefined margins in WPF printing
body: <p>Most printing samples for WPF go like this:</p>
  
  <pre><code>        PrintDialog dialog = new PrintDialog();
          if (dialog.ShowDialog() == true)
          {
             StackPanel myPanel = new StackPanel();
             myPanel.Margin = new Thickness(15);
             Image myImage = new Image();
             myImage.Width = dialog.PrintableAreaWidth;
             myImage.Stretch = Stretch.Uniform;
             myImage.Source = new BitmapImage(new Uri("pack://application:,,,/Images/picture.bmp"));
             myPanel.Children.Add(myImage);
             myPanel.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
             myPanel.Arrange(new Rect(new Point(0, 0), myPanel.DesiredSize));
             dialog.PrintVisual(myPanel, "A Great Image.");
          }
  </code></pre>
  
  <p>What I don't like about this is, that they always set the margin to a fixed value.
  But in PrintDialog the user has the option to choose a individual margin that no sample cares about. If the user now selects a margin that is larger as the fixed margin set by program, the printout is truncated.
  Is there a way to get the user selected margin value from PrintDialog?</p>
  
  <p>TIA
  Michael</p>