private void AddCategoryActionsToRow(UPMResultRow row)
        {
            var      categories      = this.Analysis.CategoryDictionary.Values;
            UPMGroup detailGroupCol1 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det1"));

            foreach (AnalysisCategory category in categories)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = category.Key,
                    StringValue = category.Label
                };

                detailGroupCol1.AddField(field);
            }

            row.AddDetailGroup(detailGroupCol1);
            UPMGroup detailGroupCol2 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det2"));

            row.AddDetailGroup(detailGroupCol2);
            foreach (var analysisResultColumn in this.AnalysisSettings.ResultColumns)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = analysisResultColumn.Key,
                    StringValue = analysisResultColumn.Label
                };
                detailGroupCol2.AddField(field);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UPInBoxPageModelController"/> class.
        /// </summary>
        /// <param name="viewReference">The view reference.</param>
        public UPInBoxPageModelController(ViewReference viewReference)
            : base(viewReference)
        {
            UPMInBoxPage page = new UPMInBoxPage(StringIdentifier.IdentifierWithStringId("Inbox"))
            {
                Invalid = true,
                SkipUploadIfPossible = viewReference.ContextValueIsSet("SkipUploadPageIfPossible")
            };

            this.removeUploadedFileFromInbox = viewReference.ContextValueIsSet("RemoveUploadedFile");
            this.TopLevelElement             = page;
            this.editFieldContexts           = new Dictionary <StringIdentifier, UPEditFieldContext>();
            IConfigurationUnitStore configStore      = ConfigurationUnitStore.DefaultStore;
            FieldControl            editFieldControl = configStore.FieldControlByNameFromGroup("Edit", viewReference.ContextValueForKey("UploadFields"));
            UPMGroup uploadFieldGroup = new UPMGroup(StringIdentifier.IdentifierWithStringId("uploadFieldGroup"));

            if (editFieldControl != null)
            {
                int numberOfFields = editFieldControl.NumberOfFields;
                for (int index = 0; index < numberOfFields; index++)
                {
                    UPConfigFieldControlField field                 = editFieldControl.FieldAtIndex(index);
                    StringIdentifier          fieldIdentifier       = StringIdentifier.IdentifierWithStringId($"Field {field.FieldId} {field.InfoAreaId}");
                    UPEditFieldContext        initialValueEditField = UPEditFieldContext.FieldContextFor(field, fieldIdentifier, null, (List <UPEditFieldContext>)null);
                    this.editFieldContexts[fieldIdentifier] = initialValueEditField;
                    if (field.Function == "Filename")
                    {
                        page.FileNameEditField = initialValueEditField.EditField;
                    }

                    uploadFieldGroup.AddField(initialValueEditField.EditField);
                }
            }

            this.recordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            page.UploadFieldGroup     = uploadFieldGroup; // load directly
            this.UpdatedElement(page);
        }