/// <summary> /// Binds the data for the template. Before accessing data outside a OnBind event, you must call this method, otherwise ItemIndex and Item might /// return false data since the template is reused and bound on occasion. /// </summary> public void Bind() { ITemplateHost host = Container as ITemplateHost; if (host != null) { host.Bind(this); } }
/// <summary> /// Binds this template with a specified item. /// </summary> /// <param name="itemIndex">The index of the item for which to bind.</param> public void Bind(int itemIndex) { ITemplateHost host = Container as ITemplateHost; if (host != null) { host.Bind(this, itemIndex); } }