コード例 #1
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);

            this.SetErrors(propertyName, propertyErrors);
        }
コード例 #2
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(()=&gt;Some Property);
        /// </example>
        public void ClearErrors <TProperty>(Expression <Func <TProperty> > propertyExpression)
        {
            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);

            this.ClearErrors(propertyName);
        }
コード例 #3
0
        /// <summary>
        /// Raises this object's Property Changed 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);

            this.OnPropertyChanged(propertyName);
        }