private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (txbFindProduct.Text == "")
            {
                products = new ObservableCollection <Detail_Product>(dbProduct.LoadData_Product());
                listviewShowProduct.ItemsSource = products;
            }
            else
            {
                ObservableCollection <Detail_Product> searchproducts = new ObservableCollection <Detail_Product>();

                searchproducts = dbProduct.SearchProduct(txbFindProduct.Text);
                if (searchproducts.Count > 0)
                {
                    listviewShowProduct.ItemsSource = searchproducts;
                }
                else
                {
                    var dialog = new Dialog()
                    {
                        Message = "Do not find any product!"
                    };
                    dialog.Owner = Window.GetWindow(this);
                    dialog.ShowDialog();
                }
                txbFindProduct.Text = "";
            }
        }
        private void ComboProductArrange_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Thread thread = new Thread(delegate()
            {
                Manage_Product dbProduct = new Manage_Product();
                products = new ObservableCollection <Detail_Product>(dbProduct.LoadData_Product());

                int Arrangeindex = 0;
                Dispatcher.Invoke(() => { Arrangeindex = comboProductArrange.SelectedIndex; });
                products = dbProduct.Arrange_Product(Arrangeindex);

                Dispatcher.Invoke(() =>
                {
                    listviewShowProduct.ItemsSource = products;
                    ProgressBar.IsEnabled           = false;
                    ProgressBar.Visibility          = Visibility.Hidden;
                });
            });

            thread.Start();
        }
        public ProductPage()
        {
            InitializeComponent();
            Thread thread = new Thread(delegate()
            {
                Manage_Product dbProduct = new Manage_Product();
                products = new ObservableCollection <Detail_Product>(dbProduct.LoadData_Product());

                int Arrangeindex = 0;
                Dispatcher.Invoke(() => { Arrangeindex = comboProductArrange.SelectedIndex; });
                products = dbProduct.Arrange_Product(Arrangeindex);

                Dispatcher.Invoke(() =>
                {
                    listviewShowProduct.ItemsSource = products;
                    ProgressBar.IsEnabled           = false;
                    ProgressBar.Visibility          = Visibility.Hidden;
                });
            });

            thread.Start();
        }