using System;
using System.Collections.Generic;
using System.Windows;
using InABox.Core;
using InABox.Wpf;
using HorizontalAlignment = System.Windows.HorizontalAlignment;

namespace InABox.Wpf.Reports
{
    /// <summary>
    ///     Interaction logic for ReportManager.xaml
    /// </summary>
    public partial class ReportManager : ThemableWindow
    {
        private readonly ReportGrid grid;

        public ReportManager()
        {
            InitializeComponent();
            grid = new ReportGrid
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Margin = new Thickness(5)
            };
            AddChild(grid);
        }

        public string Section { get; set; }

        public DataModel? DataModel { get; set; } = null;

        public bool Populate { get; set; } = false;

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Title = "Reports - " + DataModel.Name;
            grid.DataModel = DataModel;
            grid.Section = Section;
            grid.Populate = Populate;
            //grid.DataEnvironment = DataEnvironment;
            grid.Refresh(true, true);
        }
    }
}