WebReportDialogs.Blazor.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Drawing;
  3. using System.Text;
  4. using FastReport.Dialog;
  5. using Microsoft.AspNetCore.Components;
  6. using FastReport.Web.Blazor.Export;
  7. using FastReport.Web.Blazor.Components.Internal.Dialog;
  8. namespace FastReport.Web
  9. {
  10. public partial class Dialog
  11. {
  12. internal RenderFragment ProcessDialogs()
  13. {
  14. return b =>
  15. {
  16. Report report = _webReport.Report;
  17. if (CurrentForm < report.Pages.Count)
  18. {
  19. DialogPage dialog = report.Pages[CurrentForm] as DialogPage;
  20. if (!dialog.ActiveInWeb)
  21. {
  22. dialog.ActiveInWeb = true;
  23. dialog.OnLoad(EventArgs.Empty);
  24. dialog.OnShown(EventArgs.Empty);
  25. }
  26. var context = new RenderContext(b);
  27. context.OpenComponent<DialogPageComponent>();
  28. context.AddAttribute(nameof(DialogPageComponent.WebReport), _webReport);
  29. context.AddAttribute(nameof(DialogPageComponent.dialogPage), dialog);
  30. context.CloseComponent();
  31. }
  32. };
  33. }
  34. }
  35. }