Hi,
take a look at this link
http://www.switchonthecode.com/tutorials/csharp-snippet-tutorial-custom-event-handlers
IordanTanev
2010-02-15 07:46:59
Hi,
take a look at this link
http://www.switchonthecode.com/tutorials/csharp-snippet-tutorial-custom-event-handlers
Hi, You can put an event at the setter as follows. The event will be fired every time the setter is called.
public class MyObj
{
private RectangleF mRectangle;
public event EventHandler RectangleChanged;
public RectangleF Rectangle
{
get
{
return mRectangle;
}
set
{
mRectangle = value;
OnRectangleChanged();
}
}
protected virtual void OnRectangleChanged()
{
if (RectangleChanged != null)
{
RectangleChanged(this, EventArgs.Empty);
}
}
}