Beispiel #1
0
        private void ConstructChildControllers(bool isNew)
        {
            // No controller is yet selected.
            _selectedController = null;

            // Creates the controller that
            // contains the actual form.
            _compositeController = Storyboard.InstantiateViewController <DetailFormController>();
            _compositeController.Construct(_dataMap.Application, _dataMap.Composite, isNew, _dataMap, this, OnCommand, t => Title = t);
            AddChildViewController(_compositeController);
            _compositeController.DidMoveToParentViewController(this);

            _componentControllers = new List <KeyValuePair <ApplicationSchemaDefinition, DetailComponentsController> >();

            // Creates one controller for each
            // component of the composition.
            foreach (var composition in _dataMap.Application.Compositions)
            {
                var controller = Storyboard.InstantiateViewController <DetailComponentsController>();
                controller.Construct(composition, _dataMap, this);
                AddChildViewController(controller);
                controller.DidMoveToParentViewController(this);

                // "Index" the controller by
                // its application metadata.
                var component = new KeyValuePair <ApplicationSchemaDefinition, DetailComponentsController>(composition.To(), controller);
                _componentControllers.Add(component);
            }
        }
Beispiel #2
0
        public void Construct(ApplicationSchemaDefinition application, DataMap dataMap, bool isNew, CompositeDataMap composite, DetailController detailController, Action <Result> onCompletion)
        {
            _applicationMetadata = application;
            _dataMap             = dataMap;
            _onCompletion        = onCompletion;
            _isNew = isNew;

            // Creates the controller that
            // contains the actual form.
            _formController = Storyboard.InstantiateViewController <DetailFormController>();
            _formController.Construct(_applicationMetadata, _dataMap, isNew, composite, detailController, OnCommand, t => Title = t);
            AddChildViewController(_formController);
            _formController.DidMoveToParentViewController(this);
        }