ReportManager.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows;
  4. using InABox.Core;
  5. using InABox.Wpf;
  6. using HorizontalAlignment = System.Windows.HorizontalAlignment;
  7. namespace InABox.Wpf.Reports
  8. {
  9. /// <summary>
  10. /// Interaction logic for ReportManager.xaml
  11. /// </summary>
  12. public partial class ReportManager : ThemableWindow
  13. {
  14. private readonly ReportGrid grid;
  15. public ReportManager()
  16. {
  17. InitializeComponent();
  18. grid = new ReportGrid
  19. {
  20. HorizontalAlignment = HorizontalAlignment.Stretch,
  21. VerticalAlignment = VerticalAlignment.Stretch,
  22. Margin = new Thickness(5)
  23. };
  24. AddChild(grid);
  25. }
  26. public string Section { get; set; }
  27. public DataModel? DataModel { get; set; } = null;
  28. public bool Populate { get; set; } = false;
  29. private void Window_Loaded(object sender, RoutedEventArgs e)
  30. {
  31. Title = "Reports - " + DataModel.Name;
  32. grid.DataModel = DataModel;
  33. grid.Section = Section;
  34. grid.Populate = Populate;
  35. //grid.DataEnvironment = DataEnvironment;
  36. grid.Refresh(true, true);
  37. }
  38. }
  39. }