Ive implemented an event in a object like this:
public class BaseObject
{
public delegate void NavigateHandler(object sender, EventArgs e);
public virtual event NavigateHandler Navigate;
A child og that base tries to invoke it:
public class ChildObject : BaseObject
{
private void DoNavigate()
{
Navigate(null, null);
This part above is broken, VS2012 tells me that I cant use Navigate
in that manner.
However, it works fine to "hook" on that event if I instansiate a object of ChildObject
:
ChildObject obj = new ChildObject();
obj.Navigate += foo_Navigate;
Where did I go wrong? I want to trigger that navigate event in the DoNavigate
method.