Class A has an event. Class B wants to subscribe to it. Class B has an event and class A wants to subscribe to it.
I tried by creating object of class B in A and class A in B. But it's a deadlock.
I need help here...
Grey rectangles must be events. Arrow indicates that an event has to be raised from class to class
class A
{
B b;
public event EventHandler eventA;
OnEventA()
{
eventA();
}
public A()
{
b= new B();
b.eventB += DoSomethingElse();
}
}
class B
{
A a;
public B()
{
a= new A();
a.eventA += DoSomething();
}
public event EventHandler eventB;
OnEventB()
{
eventB();
}
}