using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace RevitEstimate.ElectricalModule
{
    public partial class ElectricalResultWindow : Window
    {
        public ElectricalResultWindow(List<ElectricalDsrItem> estimateData)
        {
            InitializeComponent();

            // 1. Bind Data to Grid
            GridBoq.ItemsSource = estimateData;

            // 2. Calculate Total Amount
            double totalAmount = estimateData.Sum(x => x.Amount);
            TxtTotalAmount.Text = $"Total Estimated Amount: ₹ {totalAmount:N2}";
        }
    }
}