473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to find whether a property has changed ?

Hi all,
I am not enough clear with "PropertyChanged" event handler.I want to do some operation if a specified property is changed.How do I know that a property has changed".Please help me in this issue.

Thanks,
Preethi
Feb 21 '08 #1
1 1047
Shashi Sadasivan
1,435 Expert 1GB
You would have to create a public delegate

Expand|Select|Wrap|Line Numbers
  1. public delegate void SomeValueChanged(object sender, System.EventArgs e);
  2.  
  3. class MyClass
  4. {
  5.    public event SomeValueChanged SomeValueChangedEvent;
  6.  
  7.    private int valueToChange;
  8.    public Value
  9.    {
  10.       get { return valueToChange; }
  11.       set 
  12.       { 
  13.           valueToChange = value;
  14.           //raising event here
  15.           SomeValueChangedEvent(this, System.EventArgs.Empty);
  16.       }
  17.    }
  18. }
You can specify your own event arguments class if you wish to do so.
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Job Lot | last post by:
In my custom status bar control, how can I change value of custom property when status bar’s ShowPanels property is changed? I have a progress bar embedded into status bar and have a custom...
10
by: Chris Simon | last post by:
A bit puzzled by this... 1. Ask the validator to look at http://www.nantperis.org.uk/index.php.en (the exact filename of the page) and it brings back an error: 300 Multiple Choices. I could...
1
by: Joe Jax | last post by:
I have an object which has a base object hierarchy as well as a number of implemented interfaces. Given any one property on that object, how do I find out which base class or interface defines that...
12
by: Rubbrecht Philippe | last post by:
Hi there, According to documentation I read the ArrayList.IndexOf method uses the Object.Equals method to loop through the items in its list and locate the first index of an item that returns...
6
by: S Anand | last post by:
Is there any way to find out whether a record in the form is changed or not. Say we are having a customer Form, where user can create or view customers. When the user hits the Close/Exit icon, we...
2
by: madani | last post by:
Hi, I made custom web control. this control have an Event like "TestEvent", How can I find out if properties of other controls of parent Page is changed inside this event when I fire that event...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
3
by: bharathreddy | last post by:
This article will explain you how to find the status of the fax operation. (Using FAXCOM.dll). Author: Bharath Reddy VasiReddy Reference to the FAXCOM.DLL Reference to import FAXCOM...
6
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.