我有一个这样的页面 -
public partial class ProductDetailMixed : SessionPage, IProductDetailMixedView
{
public IProductService ProductService { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
Controller = new ProductDetailMixedController(this, ProductService);
OnLoadPage();
}
public event LoadPageEvent OnLoadPage;
public IProductDetailMixedController Controller { get; set; }
}
我有属性注入,所以 IProductService 的实例将被注入到页面中,但是我真正想要的是像这样创建控制器 -
Controller = new ProductDetailMixedController(this);
然后 ProductDetailMixedController 的构造函数只会注入所有剩余的参数..但是我该怎么做呢?