2016-03-24 61 views

回答

0

让它静态的,或者如果你避免代码在构造函数,但需要获得其它实例数据,重载构造函数有一个包括你的代码和一个不

public MyPage() 
{ 
    // code to avoid 
} 

public MyPage(bool otherData) 
{ 
    // don't run the code in the default constructor 
} 

这取决于原因你不想通过构造函数。

相关问题