protected override ValidationResult IsValid(object value, ValidationContext validationContext) { SellingProduct product = (SellingProduct)validationContext.ObjectInstance; if (product.Price > 0) { return(ValidationResult.Success); } else { return(new ValidationResult("Price must get values bigger than 0!")); } }
private void button3_Click(object sender, EventArgs e) { SellingProduct sellingProduct = new SellingProduct(); sellingProduct.ShowDialog(); }