private void CountProduct_OnTextChanged(object sender, TextChangedEventArgs e) { string imgSource; if (CountProduct.Text == "" || !Int32.TryParse(CountProduct.Text, out int result)) { imgSource = "images/not.png"; EnabledButton.IsCorrectCount = false; } else { imgSource = "images/ok.png"; EnabledButton.IsCorrectCount = true; } ImgPCount.Source = new BitmapImage(new Uri(imgSource, UriKind.Relative)); AddButton.IsEnabled = EnabledButton.IsCorrect(); }
private void ProductName_OnTextChanged(object sender, TextChangedEventArgs e) { string imgSource; if (ProductName.Text == "") { imgSource = "images/not.png"; EnabledButton.IsCorrectName = false; } else { imgSource = "images/ok.png"; EnabledButton.IsCorrectName = true; } ImgPName.Source = new BitmapImage (new Uri(imgSource, UriKind.Relative)); AddButton.IsEnabled = EnabledButton.IsCorrect(); }
private void PriceProduct_OnTextChanged(object sender, TextChangedEventArgs e) { string imgSource; if (PriceProduct.Text == "" || !Double.TryParse(PriceProduct.Text, out double result)) { imgSource = "images/not.png"; EnabledButton.IsCorrectPrice = false; } else { imgSource = "images/ok.png"; EnabledButton.IsCorrectPrice = true; } ImgPPrice.Source = new BitmapImage(new Uri(imgSource, UriKind.Relative)); AddButton.IsEnabled = EnabledButton.IsCorrect(); }
public MainWindow() { InitializeComponent(); AddButton.IsEnabled = EnabledButton.IsCorrect(); }