public IntegerValidation() { foreach (Window w in Application.Current.Windows) { if (w.Title == "ProductWindow") { product_window = (ProductWindow)w; } } }
private void ProductSelected(object sender, MouseButtonEventArgs e) { ProductWindow prodWin = new ProductWindow(); ((App)Application.Current).UpdateBasket(currentClient); ((App)Application.Current).UpdateHERE(products); // listOfProducts.Items.Refresh() if (listOfProducts.SelectedItem != null) { if (prodWin.ShowDialog() == true) { } } }
public Basket(List <ProductData> productInBasket) { InitializeComponent(); productsList.ItemsSource = productInBasket; this.productInBasket = productInBasket; this.Products = Products; foreach (ProductData product in productInBasket) { productsCost += int.Parse(product.Price.ToString()) * int.Parse(product.Amount.ToString()); counter += int.Parse(product.Amount.ToString()); } allCost.Text = productsCost.ToString(); productCounter.Text = counter.ToString(); if (productInBasket.Count < 1) { commitButton.IsEnabled = false; } else { commitButton.IsEnabled = true; } }