---
title: "HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?"  
description: "HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?"  
author: "Manoj Bhatt"  
published: 2016-01-04  
updated: 2016-01-06  
canonical: https://www.mindstick.com/forum/33828/how-raise-an-event-whenever-a-property-s-value-changed  
category: "c#"  
tags: ["c#", ".net"]  
reading_time: 2 minutes  

---

# HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?

I want to use an [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) whenever a [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp)'s [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) changed . how to use this in a [program](https://www.mindstick.com/blog/12337/scaling-up-your-mentorship-program) please help me.

## Replies

### Reply by Anupam Mishra

For more details you can also read out this one: Click Here

### Reply by Manoj Bhatt

thank you sir.

### Reply by Anupam Mishra

In C#, the **INotifyPropertyChanged** interface is used notify clients, typically binding clients, that a property value has changed.

For example, consider an Employee class object with a property called FirstName. To provide property-change notification, the Employee class type implements the **INotifyPropertyChanged** interface and raises a [PropertyChanged](https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.propertychanged(v=vs.110).aspx) event when FirstName is changed.

For change notification to occur in a binding between a bound client and a data source, your bound type should either:

· Implement the **INotifyPropertyChanged****interface (preferred**).

· Provide a **change event for each property of the bound type**.

Do not do both.

For example, in below we have defined a property ‘FirstName’

```
private string _firstName;       
public string FirstName       
{            get            {                return _firstName;            }            set            {                _firstName = value;                OnPropertyChanged("FirstName");       
    }        }
```

\

Now, we have implementing the INotifyPropertyChanged interface

\

\

```
public event PropertyChangedEventHandler PropertyChanged;        
protected void OnPropertyChanged(string propertyName)       
{            OnPropertyChanged(new PropertyChangedEventArgs(propertyName));       
}  // occurring event       
private void OnPropertyChanged(PropertyChangedEventArgs e)       
{                     MessageBox.Show(“Changed in First Name ”+FirstName);        }
```

**Output:**

![HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?](https://www.mindstick.com/mindstickforums/d373d06a-30b7-4840-b2c3-8cf38ee77e1e/images/bb170c75-566c-4f8b-90ba-13951b416bf9.png)\

I think in above example you are understand about raises event when 'FirstName' property values are changed.

For more details , you click here


---

Original Source: https://www.mindstick.com/forum/33828/how-raise-an-event-whenever-a-property-s-value-changed

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
