Esempio n. 1
0
        public virtual TPage CreatePage <TModel>(CreateDynamicControlsDelegate dynCtrlsHandler)
        {
            var page = default(TPage);

            IEnumerable <IBinding> bindings;

            IRawDependencyGroup dependencies;

            m_DataBinder.Bind <TModel>(
                atts =>
            {
                page = m_PageConstructor.Create(atts);
                return(page);
            },
                (Type type, IAttributeSet atts, IGroup parent, IMetadata metadata, out int idRange) =>
            {
                idRange = 1;
                return(m_ControlConstructors.CreateElement(type, parent, atts, metadata, ref idRange));
            }, dynCtrlsHandler, out bindings, out dependencies);

            page.Binding.Load(m_App, bindings, dependencies);
            UpdatePageDependenciesState(page);

            return(page);
        }
Esempio n. 2
0
        public virtual TPage CreatePage <TModel>(TModel model)
        {
            var page = default(TPage);

            IEnumerable <IBinding> bindings;

            IRawDependencyGroup dependencies;

            m_DataBinder.Bind(model,
                              atts =>
            {
                page = m_PageConstructor.Create(atts);
                return(page);
            },
                              (Type type, IAttributeSet atts, IGroup parent, out int idRange) =>
            {
                idRange = 1;
                return(m_ControlConstructors.CreateElement(type, parent, atts, ref idRange));
            },
                              out bindings, out dependencies);

            page.Binding.Load(bindings, dependencies);
            UpdatePageDependenciesState(page);

            return(page);
        }
Esempio n. 3
0
        public virtual TPage CreatePage <TModel>(CreateDynamicControlsDelegate dynCtrlsHandler, IContextProvider modelProvider)
        {
            var page = default(TPage);

            m_DataBinder.Bind <TModel>(
                atts =>
            {
                page = m_PageConstructor.Create(atts);
                return(page);
            },
                (Type type, IAttributeSet atts, IGroup parent, IMetadata[] metadata, out int numberOfUsedIds) =>
            {
                numberOfUsedIds = 1;
                return(m_ControlConstructors.CreateElement(type, parent, atts, metadata, ref numberOfUsedIds));
            }, dynCtrlsHandler, modelProvider,
                out IEnumerable <IBinding> bindings,
                out IRawDependencyGroup dependencies,
                out IMetadata[] allMetadata);

            page.Binding.Load(m_App, bindings, dependencies, allMetadata);
            UpdatePageDependenciesState(page);

            return(page);
        }