Catel / Catel.Fody

Catel.Fody
MIT License
19 stars 9 forks source link

ObservableObject setters should check for equality before assigning #357

Open GeertvanHorrik opened 3 years ago

GeertvanHorrik commented 3 years ago

Instead of this:

        public string ExistingProperty
        {
            get => _existingProperty;
            set
            {
                _existingProperty = value;
                RaisePropertyChanged(nameof(ExistingProperty));
            }
        }

into:

        public string ExistingProperty
        {
            get => _existingProperty;
            set
            {
                if (_existingProperty == value)
                {
                    return;
                }

                _existingProperty = value;
                RaisePropertyChanged(nameof(ExistingProperty));
            }
        }
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.