Exemple #1
0
        public FormGroupBoxSettingsParameters
        (
            [NameValue(AttributeNames.DEFAULTVALUE, "Header")]
            [Comments("Title for the group box.")]
            string groupHeader,

            [Comments("Configuration for each field in the group box.")]
            List <FormItemSettingsParameters> fieldSettings,

            [Comments("Multibindings list for the group header field - typically used in edit mode.")]
            MultiBindingParameters headerBindings = null,

            [Comments("Hide this group box.")]
            bool isHidden = false
        )
        {
            if (fieldSettings.Any(s => s is FormGroupBoxSettingsParameters))
            {
                throw new ArgumentException($"{nameof(fieldSettings)}: D8590E1F-D029-405F-8E6C-EA98803004B8");
            }

            GroupHeader    = groupHeader;
            FieldSettings  = fieldSettings;
            HeaderBindings = headerBindings;
            IsHidden       = isHidden;
        }
        public DataFormSettingsParameters
        (
            [NameValue(AttributeNames.DEFAULTVALUE, "Title")]
            [Comments("Header field on the form")]
            string title,

            [Comments("Input validation messages for each field.")]
            List <ValidationMessageParameters> validationMessages,

            [Comments("List of fields and form groups for this form.")]
            List <FormItemSettingsParameters> fieldSettings,

            [Comments("Click the Variable button and select the configured FormType enum field.")]
            FormType formType,

            [Comments("The model type for the object being edited. Click the function button and use the configured GetType function.  Use the Assembly qualified type name for the type argument.")]
            Type modelType,

            [Comments("Multibindings list for the form header field - typically used in edit mode.")]
            MultiBindingParameters headerBindings = null,

            [Comments("Includes the URL's for create, read, and update.")]
            FormRequestDetailsParameters requestDetails = null,

            [Comments("Conditional directtives for each field.")]
            List <VariableDirectivesParameters> conditionalDirectives = null,

            [Comments("Multibindings list for the form header field.")]
            MultiBindingParameters subtitleBindings = null,

            [Comments("Defines a filter to find a selected item on a subsequent form e.g. to edit the selected item.")]
            ItemFilterGroupParameters itemFilterGroup = null

        )
        {
            Title              = title;
            RequestDetails     = requestDetails;
            ValidationMessages = validationMessages.ToDictionary
                                 (
                vm => vm.Field,
                vm => vm.Rules ?? new List <ValidationRuleParameters>()
                                 );
            FieldSettings         = fieldSettings;
            FormType              = formType;
            ModelType             = modelType;
            ConditionalDirectives = conditionalDirectives?.ToDictionary
                                    (
                cd => cd.Field,
                cd => cd.ConditionalDirectives ?? new List <DirectiveParameters>()
                                    );
            HeaderBindings   = headerBindings;
            SubtitleBindings = subtitleBindings;
            ItemFilterGroup  = itemFilterGroup;
        }
        public FormGroupArraySettingsParameters
        (
            [ParameterEditorControl(ParameterControlType.ParameterSourcedPropertyInput)]
            [NameValue(AttributeNames.PROPERTYSOURCEPARAMETER, "fieldTypeSource")]
            [Comments("Update fieldTypeSource first. Source property name from the target object.")]
            string field,

            [Comments("Update listElementTypeSource first. Usually just a list of one item - the primary key. Additional fields apply when the primary key is a composite key.")]
            [ParameterEditorControl(ParameterControlType.ParameterSourcedPropertyInput)]
            [NameValue(AttributeNames.PROPERTYSOURCEPARAMETER, "listElementTypeSource")]
            List <string> keyFields,

            [NameValue(AttributeNames.DEFAULTVALUE, "Title")]
            [Comments("Title for the form group.")]
            string title,

            [NameValue(AttributeNames.DEFAULTVALUE, "(Form Collection)")]
            [Comments("e.g. (Addresses). Placeholder text for the for multi-form control on the parent form.")]
            string placeholder,

            [Comments("e.g. T. The element type for the list being edited. Click the function button and use the configured GetType function.  Use the Assembly qualified type name for the type argument.")]
            Type modelType,

            [Comments("e.g. ICollection<T>. The type for the list being edited. Click the function button and use the configured GetType function.  Use the Assembly qualified type name for the type argument.")]
            Type type,

            [NameValue(AttributeNames.DEFAULTVALUE, "(Form)")]
            [Comments("Placeholder text for the for control when the form is a one-to-one form field.")]
            string validFormControlText,

            [NameValue(AttributeNames.DEFAULTVALUE, "(Invalid Form)")]
            [Comments("Placeholder text for the for control when the form is a one-to-one form field and the form is invalid.")]
            string invalidFormControlText,

            [Comments("Template and property bindings to be displayed for each item in the list.")]
            FormsCollectionDisplayTemplateParameters formsCollectionDisplayTemplate,

            [Comments("XAML template for the form group.")]
            FormGroupTemplateParameters formGroupTemplate,

            [Comments("Configuration for each field in one of the array's form groups.")]
            List <FormItemSettingsParameters> fieldSettings,

            [Comments("Input validation messages for each field.")]
            List <ValidationMessageParameters> validationMessages,

            [Comments("Conditional directtives for each field.")]
            List <VariableDirectivesParameters> conditionalDirectives = null,

            [Comments("Multibindings list for the form header field.")]
            MultiBindingParameters headerBindings = null,

            [ParameterEditorControl(ParameterControlType.ParameterSourceOnly)]
            [Comments("Fully qualified class name for the model type.")]
            string fieldTypeSource = "Enrollment.Domain.Entities",

            [ParameterEditorControl(ParameterControlType.ParameterSourceOnly)]
            [Comments("Fully qualified class name for the model type.")]
            string listElementTypeSource = "Enrollment.Domain.Entities"
        )
        {
            Field                          = field;
            Title                          = title;
            Placeholder                    = placeholder;
            ModelType                      = modelType;
            Type                           = type;
            ValidFormControlText           = validFormControlText;
            InvalidFormControlText         = invalidFormControlText;
            KeyFields                      = keyFields;
            FormsCollectionDisplayTemplate = formsCollectionDisplayTemplate;
            FormGroupTemplate              = formGroupTemplate;
            FieldSettings                  = fieldSettings;
            ValidationMessages             = validationMessages.ToDictionary
                                             (
                vm => vm.Field,
                vm => vm.Rules ?? new List <ValidationRuleParameters>()
                                             );
            ConditionalDirectives = conditionalDirectives?.ToDictionary
                                    (
                cd => cd.Field,
                cd => cd.ConditionalDirectives ?? new List <DirectiveParameters>()
                                    );
            HeaderBindings = headerBindings;
        }
Exemple #4
0
        public FormGroupSettingsParameters
        (
            [ParameterEditorControl(ParameterControlType.ParameterSourcedPropertyInput)]
            [NameValue(AttributeNames.PROPERTYSOURCEPARAMETER, "fieldTypeSource")]
            [Comments("Update fieldTypeSource first. Source property name from the target object.")]
            string field,

            [NameValue(AttributeNames.DEFAULTVALUE, "Title")]
            [Comments("Title for the form group.")]
            string title,

            [NameValue(AttributeNames.DEFAULTVALUE, "(Form)")]
            [Comments("Placeholder text for the for control when the form is a one-to-one form field. May need to remove this for form arrays..")]
            string validFormControlText,

            [NameValue(AttributeNames.DEFAULTVALUE, "(Invalid Form)")]
            [Comments("Placeholder text for the for control when the form is a one-to-one form field and the form is invalid. May need to remove this for form arrays..")]
            string invalidFormControlText,

            [Comments("Place holder text.")]
            [NameValue(AttributeNames.DEFAULTVALUE, "(Property name)")]
            string placeholder,

            [Comments("The entity type for the object being edited. Click the function button and use the configured GetType function.  Use the Assembly qualified type name for the type argument.")]
            Type modelType,

            [Comments("XAML template for the form group.")]
            FormGroupTemplateParameters formGroupTemplate,

            [Comments("Configuration for each field in the form group.")]
            List <FormItemSettingsParameters> fieldSettings,

            [Comments("Input validation messages for each field.")]
            List <ValidationMessageParameters> validationMessages,

            [Comments("Conditional directtives for each field.")]
            List <VariableDirectivesParameters> conditionalDirectives = null,

            [Comments("Multibindings list for the form header field.")]
            MultiBindingParameters headerBindings = null,

            [ParameterEditorControl(ParameterControlType.ParameterSourceOnly)]
            [Comments("Fully qualified class name for the model type.")]
            string fieldTypeSource = "Enrollment.Domain.Entities"
        )
        {
            Field = field;
            Title = title;
            ValidFormControlText   = validFormControlText;
            InvalidFormControlText = invalidFormControlText;
            Placeholder            = placeholder;
            ModelType          = modelType;
            FormGroupTemplate  = formGroupTemplate;
            FieldSettings      = fieldSettings;
            ValidationMessages = validationMessages.ToDictionary
                                 (
                vm => vm.Field,
                vm => vm.Rules ?? new List <ValidationRuleParameters>()
                                 );
            ConditionalDirectives = conditionalDirectives?.ToDictionary
                                    (
                cd => cd.Field,
                cd => cd.ConditionalDirectives ?? new List <DirectiveParameters>()
                                    );
            HeaderBindings = headerBindings;
        }