/// <summary> /// Raises the property changed event for the property specified by a property expression. /// </summary> /// <typeparam name="TProperty">The type of the property.</typeparam> /// <param name="propertyExpression">The property expression.</param> protected void RaisePropertyChanged <TProperty>(Expression <Func <TProperty> > propertyExpression) { this.RaisePropertyChanged(ExpressionUtilities.GetName(propertyExpression)); }
/// <summary> /// Sets the property value. /// </summary> /// <typeparam name="T">The type of the property.</typeparam> /// <param name="field">The field.</param> /// <param name="value">The value.</param> /// <param name="propertyExpression">The property expression.</param> /// <returns> /// True if the property was set. /// </returns> /// <remarks>This method uses the CallerMemberNameAttribute to determine the property name.</remarks> protected bool SetValue <T>(ref T field, T value, Expression <Func <T> > propertyExpression) { // ReSharper disable once ExplicitCallerInfoArgument return(this.SetValue(ref field, value, ExpressionUtilities.GetName(propertyExpression))); }