문제

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.

도움이 되었습니까?

해결책

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
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top