예제 #1
0
        private bool Validate(string nomePropriedade)
        {
            ValidationResult result = null;

            switch (nomePropriedade)
            {
            case "Codigo":
                result = Validator.GetResult(() => Codigo);
                break;

            case "Valor":
                result = Validator.GetResult(() => Valor);
                break;

            case "ALL":
                result = Validator.ValidateAll();
                break;
            }

            Errors = result.AsObservableDictionary();
            return(result.IsValid);
        }