Ejemplo n.º 1
0
        /// <summary>
        ///     Clears the errors for the property indicated by the property expression.
        /// </summary>
        /// <typeparam name="TProperty">The property type.</typeparam>
        /// <param name="propertyExpression">The expression indicating a property.</param>
        /// <example>
        ///     container.ClearErrors(()=>SomeProperty);
        /// </example>
        public void ClearErrors <TProperty>(Expression <Func <TProperty> > propertyExpression)
        {
            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);

            ClearErrors(propertyName);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Sets the validation errors for the specified property.
        /// </summary>
        /// <typeparam name="TProperty">The property type for which to set errors.</typeparam>
        /// <param name="propertyExpression">The <see cref="Expression" /> indicating the property.</param>
        /// <param name="propertyErrors">The list of errors to set for the property.</param>
        public void SetErrors <TProperty>(Expression <Func <TProperty> > propertyExpression, IEnumerable <T> propertyErrors)
        {
            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);

            SetErrors(propertyName, propertyErrors);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Raises this object's PropertyChanged event.
        /// </summary>
        /// <typeparam name="T">The type of the property that has a new value</typeparam>
        /// <param name="propertyExpression">A Lambda expression representing the property that has a new value.</param>
        protected void OnPropertyChanged <T>(Expression <Func <T> > propertyExpression)
        {
            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);

            RaisePropertyChanged(propertyName);
        }