Waiting on class methods?

Given a hypothetical class ComplexGUIClass that requires multiple color values and screen coordinates, and the following code:

MouseEventHandler newH = new MouseEventHandler(someMethodInsideMyClass); somebutton.click += newH; ComplexGUIClass newInstance = new ComplexGUIClass(); mainGUI.Children.Add(newInstance); somebutton.click =- newH; 

This will not give the desired result because it will likely add the instance of ComplexGUI Class before it is fully built. What steps could I take to 'pause' while the class instance is being assembled? Or am I thinking about this incorrectly?

by ArchieTect via /r/csharp

Leave a Reply