Report.WPF.cs 811 B

123456789101112131415161718192021222324252627282930
  1. using FastReport.Preview;
  2. namespace FastReport
  3. {
  4. partial class Report
  5. {
  6. private WpfPreviewControl wpfPreview;
  7. /// <summary>
  8. /// Gets or sets the WPF preview control.
  9. /// </summary>
  10. public WpfPreviewControl WpfPreview
  11. {
  12. get => wpfPreview;
  13. set
  14. {
  15. wpfPreview = value;
  16. if (wpfPreview != null)
  17. Preview = wpfPreview.InnerPreview;
  18. }
  19. }
  20. /// <summary>
  21. /// Prepares the report and shows it in the provided PreviewControl (async way).
  22. /// </summary>
  23. /// <param name="preview">The preview control.</param>
  24. public void PrepareAsync(WpfPreviewControl preview) => PrepareAsync(preview?.InnerPreview);
  25. }
  26. }