---
title: "Property Notification in c#"  
description: "In this blog I will told you that how to create property notification in c#. Here I will provide you a sample through which you can easily learn that"  
author: "James Smith"  
published: 2011-07-09  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/205/property-notification-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Property Notification in c#

In this [blog](https://www.mindstick.com/articles/12705/myths-and-misconception-about-blog) I will told you that how to create [property](https://www.mindstick.com/blog/152/property-in-c-sharp) [notification](https://www.mindstick.com/forum/34148/how-to-create-xml-layout-for-notification-activity) in c#. Here I will provide you a [sample](https://www.mindstick.com/news/2174/mars-mission-by-nasa-prepares-for-tests) through which you can easily learn that how to create property notification.

```
using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace PropertyNotificatioDemo{    class Program    {        static void Main(string[] args)        {            PropertyNotification notification = new PropertyNotification();   //Create an object of PropertyNotification class.            //Create EmployeeValueChange handler.            PropertyNotification.EmployeeValueChange += new PropertyNotification.EmployeeNameHandler(PropertyNotification_EmployeeValueChange);             //Display a message.            Console.Write("Enter Value  :  ");            //Read a value and initilize it in property.            notification.EmployeeName = Console.ReadLine();        }         //Handler for property notification is created.        static void PropertyNotification_EmployeeValueChange(object sender, EventArgs e)        {            Console.WriteLine("Employee name is changed."+sender);        }    }     public class PropertyNotification    {        //Create a private variable which store value.        private static string _employeeName;        //Create a delegate of named EmployeeNamed=Handler        public delegate void EmployeeNameHandler(object sender, EventArgs e);         //Create a event variable of EmployeeNameHandler        public static event EmployeeNameHandler EmployeeValueChange;         //Create a static method named OnEmployeeNameChanged        public static void OnEmployeeNameChanged(EventArgs e)        {            if (EmployeeValueChange != null)                EmployeeValueChange(_employeeName, e);        }         //Create a property EmployeeName        public string EmployeeName        {            get            {                return _employeeName;            }            set            {                //Check if value of property is not same.                if (_employeeName != value)                {                    OnEmployeeNameChanged(new EventArgs());                    _employeeName = value;                }            }        }    }}
```

\

We got a notification [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) [as well as](https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application) we change [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) of EmployeeName property.

---

Original Source: https://www.mindstick.com/blog/205/property-notification-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
