src/GenFx/ObservableObject.cs
/// <summary>
/// Sets the state of a property.
/// </summary>
/// <param name="fieldValue">Backing field value of the property.</param>
/// <param name="newValue">New value being assigned to the property.</param>
/// <param name="propertyName">Name of the property.</param>
/// <typeparam name="T">Type of the property.</typeparam>
Sets the state of a property.
Sets the state of a property .
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#")]
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
        protected virtual void SetProperty<T>(ref T fieldValue, T newValue, [CallerMemberName] string propertyName = "")
        {
            if (!Object.Equals(fieldValue, newValue))
            {
                fieldValue = newValue;
                this.OnPropertyChanged(propertyName);
            }
        }
[ System . Diagnostics . CodeAnalysis . SuppressMessage ( " " , " " , MessageId = " " ) ] [ System . Diagnostics . CodeAnalysis . SuppressMessage ( " " , " " ) ] protected virtual void SetProperty < T > ( ref T fieldValue , T newValue , [ CallerMemberName ] string propertyName = " " ) { if ( ! Object . Equals ( fieldValue , newValue ) ) { fieldValue = newValue ; this . OnPropertyChanged ( propertyName ) ; } }
Sets the state of a property.
Sets the state of a property .
T
ref
<not_specific>
newValue
T
New value being assigned to the property.
New value being assigned to the property .
string
[CallerMemberName]
<not_specific>
fieldValue
<not_specific>
Backing field value of the property.
Backing field value of the property .
propertyName
<not_specific>
Name of the property.
Name of the property .
typeparam
Type of the property.
Type of the property .