Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:31:34+00:00 2026-05-26T06:31:34+00:00

(using .Net 3.5) I have a routine that imports settings from an external datasource,

  • 0

(using .Net 3.5) I have a routine that imports settings from an external datasource, after which I need to display a pseudo-log to the user detailing which properties have been updated. Usually I would track property updates through the property_changed events. However, when the value from the datasource happens to already equal the property value, then property_changed event never gets raised, even if the property set was called. But I still need to display such properties to the user as being “updated” from the datasource.

What is the common pattern here? Do I need another event (in addtion to property_changed) in my property setters- “property_attemptedset”?

Edit: So one suggestion is that I simply not do an equality check in the property setter, so that “property_changed” gets fired no matter what. But I’ve always been told to filter for actual value changes. Is that not best practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:31:35+00:00Added an answer on May 26, 2026 at 6:31 am

    if you write your properties like this:

    public string LastName{
        get { return lastName; }
        set {
            lastName = value;
            RaisePropertyChanged("LastName");
        }
    }
    

    It should always fire the PropertyChanged-event, even if the value is the same. You don’t need to fire any additional events for this.

    EDIT

    in addition to your edit: Yes, it is considered best practice to check for actual value changes, but if your scenario needs to track non-value changes, I don’t see why you can’t change it. “Best practice” doesn’t mean “Break-this-rule-and-go-to-jail” thing right?
    But in case these classes have any other observers, which also rely on the common PropertyChanged behavior, you can always extend the properties and throw another (custom) event like you mentioned:

        public event PropertyChangedEventHandler AttemptedPropertyChanged;
        public void RaiseAttemptedPropertyChanged(string propName)
        {
            if (AttemptedPropertyChanged != null)
            {
                AttemptedPropertyChanged(this, new PropertyChangedEventArgs(propName));
            }
        }
    
    
        public string LastName{
            get { return lastName; }
            set {                
                RaiseAttemptedPropertyChanged("LastName");
                if (lastName == value) return;
                lastName = value;
                RaisePropertyChanged("LastName");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I am using vb.net language I have a dropdownlist, which is filled by below
I have created a Data Access Layer using .NET. Everywhere that I update a
I have an ASP.NET application using an entity framework model. In an import routine,
I have created a basic site using ASP.NET routing according to Mike Ormond's example
sending mail along with embedded image using asp.net I have already used following but
Using the .net framework you have the option to create temporary files with Path.GetTempFileName();
I'm using .NET 3.5 and I have a class, A, marked as internal sealed
I have previously written user interfaces using .NET and Windows Forms. I'm about to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.