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 284405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:27:20+00:00 2026-05-12T05:27:20+00:00

Is it appropriate to fire a property changed event when the actual value of

  • 0

Is it appropriate to fire a “property changed” event when the actual value of a property does not change?

public int SomeProperty
{
    get { return this.mSomeProperty; }
    set
    {
        this.mSomeProperty = value;
        OnPropertyChanged(new PropertyChangedEventArgs("SomeProperty"));
    }
}

This will trigger the event even when the new value is identical to the old value. Is this bad 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-12T05:27:20+00:00Added an answer on May 12, 2026 at 5:27 am

    Best practice is not to throw the event unless the value changed.

    In your case the property is just an ‘int’, so it’s just a simple equality check. If your property was an object in it’s own right, there are more cases to consider

    1. You set the same instance again – No property change

    2. You set a different instance with different values – Throw a property change

    3. You set a different, but ‘equal’ instance ( i.e., the two different objects have the same set of values and can be considered equivalent from your application’s point of view ) – Throw a property change.

    The last one is subject to some debate… has the property really changed when all of it’s attributes are the same? If someone is using that property change to subscribe to changes in the subclass, they will need it to know to unsubscribe from the old class and subscribe to the new one. Therefore I err on the side of announcing the change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the appropriate regex to get the last word in these sentences:
What's the appropriate way to get the non-handle type in the following code: template
Which is appropriate: class xyz { static int xyzOp1() { } static int xyzOp2()
What is the appropriate method to get the already-initialized javascript to interact with content
I have a System.Threading.Timer that calls its appropriate event handler (callback) every 10 ms
Attempting to get LocationUpdates in my Service, however, it doesnt ever seem to fire
What would be the appropriate WAI ARIA treatment for hidden elements (hidden by CSS),
would it be appropriate to use PHP's sscanf to read user submitted sentences and
When is it appropriate to use openGl-es on the iPhone versus other toolkits? I
When is it appropriate to use connection pooling and what happens when the maximum

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.