Ejemplo n.º 1
0
        public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "LocationField") {
                yield break;
            }

            var model = new LocationFieldSettings();
            if (updateModel.TryUpdateModel(model, "LocationFieldSettings", null, null)) {
                builder.WithSetting("LocationFieldSettings.Required", model.Required.ToString());
            }

            yield return DefinitionTemplate(model);
        }
Ejemplo n.º 2
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "LocationField")
            {
                yield break;
            }

            var model = new LocationFieldSettings();

            if (updateModel.TryUpdateModel(model, "LocationFieldSettings", null, null))
            {
                builder.WithSetting("LocationFieldSettings.Required", model.Required.ToString());
            }

            yield return(DefinitionTemplate(model));
        }