jeudi 3 janvier 2019

Design Problem - Passing data which is received from Event handler to another Class

i've encountered a design problem in my small application.

In my Form1 I have an event handler which the argument contains a specific data I want to pass another class (Let's call it class A). Sounds easy, but it's tough design problem.

Class A cannot work correctly without having this specific data from the Form1 event handler, and there is no other way to get this data rather than the event handler.

The design problem is that I want to call a method from class A in the Form1 OnLoaded handler, but I can't because of this specific data so therefor the current workaround is to call it from within the event handler which is not what I want.

Your help would be appreciated, thank you SoF.

Aucun commentaire:

Enregistrer un commentaire