using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Demo2703.Models;
using System.Linq;

namespace Demo2703;

public partial class History : Window
{
    public History()
    {
        InitializeComponent();

        ListBOX.ItemsSource = Helper.SaleProduct;
        FilterProduct.ItemsSource = Helper.allProducts;
    }

    private void ComboBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
    {
        ListBOX.ItemsSource = Helper.SaleProduct.Where(i => i.Productid == (FilterProduct.SelectedItem as Product).Id);
    }
}