/// <summary>
        /// Builds the page.
        /// </summary>
        public override void BuildPage()
        {
            this.ConfigName  = this.ViewReference.ContextValueForKey("ConfigName");
            this.ConfigTabNr = Convert.ToInt32(this.ViewReference.ContextValueForKey("ConfigTabNr"));
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            Form form = configStore.FormByName(this.ConfigName);

            this.formtab = null;
            MDashboardPage _page = (MDashboardPage)this.InstantiatePage();

            if (this.ConfigTabNr < form.NumberOfTabs)
            {
                if (this.ConfigTabNr < 0)
                {
                    this.ConfigTabNr = 0;
                }

                this.formtab = form.TabAtIndex(this.ConfigTabNr);
            }
            else
            {
                this.Logger.LogError($"Configured ConfigTabNr {this.ConfigTabNr} is larger than the number of available tabs {form.NumberOfTabs}");

                // DDLogError("Configured ConfigTabNr (%ld) is larger than the number of available tabs (%lu)", (long)this.ConfigTabNr, (unsigned long)form.NumberOfTabs());
                return;
            }

            _page.LabelText = !string.IsNullOrWhiteSpace(this.formtab.Label) ? this.formtab.Label : "*** FormTab Label Missing ***";

            _page.Invalid        = true;
            this.TopLevelElement = _page;
            string copyRecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            string copyFieldGroupName       = this.ViewReference.ContextValueForKey("CopySourceFieldGroupName");

            this.copyFields = null;

            if (copyRecordIdentification.IsRecordIdentification() && !string.IsNullOrWhiteSpace(copyFieldGroupName))
            {
                FieldControl fieldControl = configStore.FieldControlByNameFromGroup("List", copyFieldGroupName);
                if (fieldControl != null)
                {
                    this.copyFields = new UPCopyFields(fieldControl);
                }
            }

            if (this.copyFields != null)
            {
                this.copyFields.CopyFieldValuesForRecordIdentification(copyRecordIdentification, false, this);
            }
            else
            {
                this.ContinueWithCopyFields(null);
            }
        }
        /// <summary>
        /// Updateds the element for page.
        /// </summary>
        /// <param name="oldDetailPage">The old detail page.</param>
        /// <returns></returns>
        public override UPMElement UpdatedElementForPage(Page oldDetailPage)
        {
            MDashboardPage detailPage = (MDashboardPage)this.InstantiatePage();

            lock (this)
            {
                //this.InformAboutDidChangeTopLevelElement(detailPage, detailPage, null, UPChangeHints.ChangeHintsWithHint(Constants.GroupPageChangeHint));
                //Thread.Sleep(2000);
                //List<IIdentifier> changeIdentifier = new List<IIdentifier>();
                foreach (UPGroupModelController groupModelController in this.GroupModelControllerArray)
                {
                    //if (!(groupModelController is UPListResultGroupModelController))
                    //{
                    groupModelController.ApplyContext(this.ValueDictionary);
                    //}
                }

                foreach (UPGroupModelController groupModelController in this.GroupModelControllerArray)
                {
                    if (groupModelController.Group != null)
                    {
                        groupModelController.Group.ConfiguredPostionOfGroup = groupModelController.RootTabIndex;
                        detailPage.AddGroup(groupModelController.Group);
                        //if (groupModelController.ControllerState == GroupModelControllerState.Finished)
                        //{
                        //    changeIdentifier.Add(groupModelController.Group.Identifier);
                        //}
                    }
                }

                detailPage.Invalid = false;
                //this.InformAboutDidChangeTopLevelElement(detailPage, detailPage, changeIdentifier, UPChangeHints.ChangeHintsWithHint(Constants.GroupAddedToPageHint));
            }

            return(detailPage);
        }