Hello,
I was reading in the book: Chapter 6, Page: 147 lists the following code:
Code:
public class MyActivity : Activity
{
public static readonly DependencyProperty SomethingHappenedEvent;
public event EventHandler SomethingHappened
{
add
{
base.AddHandler(MyActivity.SomethingHappenedEvent, value);
}
remove
{
base.RemoveHandler(MyActivity.SomethingHappendEvent, value);
}
}
}
Now, my question: is it a good practice to declare the event with the "readonly" modifier? I did not use to do so my self. Also, I'm using VS'08 with WF 3.5; if I declare a DependencyProperty or a DependencyEvent I use code snippets 'wdp' and 'wde' respectively and the code generated does not include the readonly modifier.
Thank you.