How does Presenter get Instantiated?

Topics: Web Client Software Factory, User Forum
Sep 16, 2007 at 9:23 AM
public partial class Catalog_Category : System.Web.UI.Page, ICategoryView
private CategoryViewPresenter _presenter; // <!--- This, what is instantiating it

protected void Page_Load(object sender, EventArgs e)
if (!this.IsPostBack)
Sep 16, 2007 at 4:27 PM
Hi, if you look closely at the generated code, there should be a set-only property that wraps the _presenter field. This property is decorated with the CreateNew attribute. The attribute tells WCSF (to be more specific: the ObjectBuilder component) to dynamically create an instance of the CategoryViewPresenter. It was also take care of any StateValue fields and other fields, arguments and properties using the CreateNew and Dependency attributes.