I have an object model like this:
public class MyObject{
public int Prop1{get;set;}
public int Prop2{get;set;}
public void MyObjectInit()
{
this.Prop1 = 0;
this.Prop2 = 0;
}
}
How do I create an event handler for MyObject that triggers when the object is initialized and runs MyObjectInit.
Thanks
Why use an event handler. Just use the object constructor.
Or better yet, move the code of
MyObjectInitinto the constructor.