What does equating an EventHandler type var to a delegate mean in C#?
I consider my self new to CSharp. I have encountered this piece if code
and cannot understand what it does.
I have not seen enywhere that an EventHandler is equal to a delegate ?
What does that do? Of course below is an excerpt of the the complete code
since I am hoping that would be enough for someone to understand the
general concept of equating an Event Handler to a delegate. Thanks.
public class xyz : ViewModelBase
{
protected EventHandler modelChanged = null;
public xyz ( int a, int b)
{
this.modelChanged =
delegate
{
// check for changes.
if (this.ChangesExist == false)
{
// set the flag
this.ChangesExist = true;
// append the title.
currentTitle += "*";
_changeTitle(currentTitle);
}
};
}
}
No comments:
Post a Comment