示例#1
0
		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();
		}
示例#2
0
		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();
		}
示例#3
0
		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();
		}
示例#4
0
		public MainWindow()
		{
			InitializeComponent();
			AddButton.IsEnabled = EnabledButton.IsCorrect();
		}