ReportManager.xaml.cs 1.3 KB

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