private void RemoveProductButton_Click(object sender, RoutedEventArgs e)
        {
            var removeButton = (Button)sender;

            removedProduct = (ProductBought)removeButton.DataContext;

            customerOrder.ProductsBoughtList.Remove(removedProduct);


            foreach (var item in merchandiseManager.merchlist)
            {
                if (item.Name == removedProduct.Product.Name)
                {
                    removedProduct.ProductCurrentStock += removedProduct.QuantityBought;
                    customerOrder.Quantity             -= removedProduct.QuantityBought;
                }
            }
        }
        private void AddProductToOrderButton_Click(object sender, RoutedEventArgs e)
        {
            clickedProduct = new ProductBought();

            AddToCart_listview.ItemsSource = customerOrder.ProductsBoughtList;
            cartTitle.Visibility           = Visibility.Visible;

            var       parent = (sender as Button).Parent;
            TextBlock findSelectedProductTextblock = parent.GetChildrenOfType <TextBlock>().First(x => x.Name == "productName");


            foreach (var item in merchandiseManager.merchlist)
            {
                if (item.Name == findSelectedProductTextblock.Text)
                {
                    clickedProduct.Product = item;
                    _merch = item;
                    clickedProduct.Product.Stock       = item.Stock;
                    clickedProduct.ProductCurrentStock = item.Stock;
                }
            }

            TextBox findQuantityTextbox = parent.GetChildrenOfType <TextBox>().First(x => x.Name == "quantityInput");

            if (int.TryParse(findQuantityTextbox.Text, out _quantity))
            {
                int  foundIndex = 0;
                bool found      = false;
                for (int i = 0; i < customerOrder.ProductsBoughtList.Count; i++)
                {
                    if (clickedProduct.Product.MerchandiseId == customerOrder.ProductsBoughtList[i].Product.MerchandiseId)
                    {
                        found = true;
                        clickedProduct.QuantityBought += customerOrder.ProductsBoughtList[i].QuantityBought + _quantity;
                        foundIndex = i;
                    }
                }

                if (!found)
                {
                    clickedProduct.QuantityBought = _quantity;
                    customerOrder.Quantity       += _quantity;
                }

                if (clickedProduct.QuantityBought <= clickedProduct.ProductCurrentStock && clickedProduct.QuantityBought > 0)
                {
                    if (found)
                    {
                        customerOrder.ProductsBoughtList.RemoveAt(foundIndex);
                        customerOrder.Quantity += _quantity;
                    }

                    customerOrder.ProductsBoughtList.Add(clickedProduct);
                    clickedProduct.ProductCurrentStock -= clickedProduct.QuantityBought;


                    AddToCart_listview.Visibility = Visibility.Visible;

                    TextBlock findStockTextBlock = parent.GetChildrenOfType <TextBlock>().First(x => x.Name == "inStock_TextBlock");
                    findStockTextBlock.Text = clickedProduct.Product.Stock.ToString();
                }
                else
                {
                    var anotherDialog = new MessageDialog("Du har angett fel antal");
                    var y             = anotherDialog.ShowAsync().GetAwaiter();
                }
            }
            else
            {
                var dialog = new MessageDialog("Gör om, gör rätt");
                var t      = dialog.ShowAsync().GetAwaiter();
            }
            findQuantityTextbox.Text = "";
        }