Question

Basically, in my application's initialization, I want to set the value of a control's property once it has been loaded. In MonoMac, it appears that when the MainWindowController's Initialize method is called, the control outlets are not necessarily available (they are null).

I couldn't find any events such as LoadComplete that I could listen on and then do the required initialization on my control.

Était-ce utile?

La solution

You should use the AwakeFromNib method in your MainWindowController class. It is called once all the objects have been loaded and connected.

public override void AwakeFromNib ()
{
    base.AwakeFromNib ();

    // Do something here with the outlets
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top