ReportManager.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 Dictionary<Type, CoreTable> DataEnvironment { get; set; }
  28. public DataModel? DataModel { get; set; } = null;
  29. public bool Populate { get; set; } = false;
  30. private void Window_Loaded(object sender, RoutedEventArgs e)
  31. {
  32. Title = "Reports - " + DataModel.Name;
  33. grid.DataModel = DataModel;
  34. grid.Section = Section;
  35. grid.Populate = Populate;
  36. //grid.DataEnvironment = DataEnvironment;
  37. grid.Refresh(true, true);
  38. }
  39. }
  40. }