public void RemoveUnusedControls()
        {
            ProductListUserControl productListUC = CartView.CartUC.ProductsUC;

            // CPU
            productListUC.CPUGrid.Children.Remove(productListUC.CPUTitle);
            productListUC.CPUGrid.Children.Remove(productListUC.CPUBtns);

            // GPU
            productListUC.GPUGrid.Children.Remove(productListUC.GPUTitle);
            productListUC.GPUGrid.Children.Remove(productListUC.GPUBtns);

            // Motherboard
            productListUC.MotherboardGrid.Children.Remove(productListUC.MotherboardTitle);
            productListUC.MotherboardGrid.Children.Remove(productListUC.MotherboardBtns);

            // Memory
            productListUC.MemoryGrid.Children.Remove(productListUC.MemoryTitle);
            productListUC.MemoryGrid.Children.Remove(productListUC.MemoryBtns);

            // Storage
            productListUC.StorageGrid.Children.Remove(productListUC.StorageTitle);
            productListUC.StorageGrid.Children.Remove(productListUC.StorageBtns);

            // PSU
            productListUC.PSUGrid.Children.Remove(productListUC.PSUTitle);
            productListUC.PSUGrid.Children.Remove(productListUC.PSUBtns);

            // Case
            productListUC.CaseGrid.Children.Remove(productListUC.CaseTitle);
            productListUC.CaseGrid.Children.Remove(productListUC.CaseBtns);
        }
        /// <summary>
        /// Addition to the cart only possible if a product is selected.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private bool CanAddToCart(object obj)
        {
            ProductListUserControl productListUC = CartView.CartUC.ProductsUC;

            if (productListUC.CPUList.SelectedIndex != -1 ||
                productListUC.GPUList.SelectedIndex != -1 ||
                productListUC.MotherboardList.SelectedIndex != -1 ||
                productListUC.MemoryList.SelectedIndex != -1 ||
                productListUC.StorageList.SelectedIndex != -1 ||
                productListUC.PSUList.SelectedIndex != -1 ||
                productListUC.CaseList.SelectedIndex != -1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Adds the selected product to the cart's items.
        /// </summary>
        /// <param name="obj"></param>
        private void ExecAddToCart(object obj)
        {
            ProductListUserControl productListUC = CartView.CartUC.ProductsUC;
            CartItem cartItem = new CartItem();

            cartItem.Cart     = Cart;
            cartItem.Quantity = 1;

            if (productListUC.CPUList.SelectedIndex != -1) // CPU
            {
                CPU cpu = (CPU)productListUC.CPUList.SelectedItem;
                CPUs.Remove(cpu);
                cartItem.Product = cpu;
                cartItem.Price   = cpu.Price;
            }
            else if (productListUC.GPUList.SelectedIndex != -1) // GPU
            {
                GPU gpu = (GPU)productListUC.GPUList.SelectedItem;
                GPUs.Remove(gpu);
                cartItem.Product = gpu;
                cartItem.Price   = gpu.Price;
            }
            else if (productListUC.MotherboardList.SelectedIndex != -1) // Motherboard
            {
                Motherboard motherboard = (Motherboard)productListUC.MotherboardList.SelectedItem;
                Motherboards.Remove(motherboard);
                cartItem.Product = motherboard;
                cartItem.Price   = motherboard.Price;
            }
            else if (productListUC.MemoryList.SelectedIndex != -1) // Memory
            {
                Memory memory = (Memory)productListUC.MemoryList.SelectedItem;
                Rams.Remove(memory);
                cartItem.Product = memory;
                cartItem.Price   = memory.Price;
            }
            else if (productListUC.StorageList.SelectedIndex != -1) // Storage
            {
                Storage storage = (Storage)productListUC.StorageList.SelectedItem;
                StorageComponents.Remove(storage);
                cartItem.Product = storage;
                cartItem.Price   = storage.Price;
            }
            else if (productListUC.PSUList.SelectedIndex != -1) // PSU
            {
                PSU psu = (PSU)productListUC.PSUList.SelectedItem;
                PSUs.Remove(psu);
                cartItem.Product = psu;
                cartItem.Price   = psu.Price;
            }
            else // Case
            {
                Case pcCase = (Case)productListUC.CaseList.SelectedItem;
                Cases.Remove(pcCase);
                cartItem.Product = pcCase;
                cartItem.Price   = pcCase.Price;
            }

            cartItem.Product.Stock--;
            Cart.Total += cartItem.Price;
            Cart.Items.Add(cartItem);
        }