Пример #1
0
        public void Infer(Field field, Binding binding)
        {
            var previousBinding = GetPreviousFieldBinding(field);
            if (previousBinding == binding)
            {
                return;
            }

            SetPreviousFieldBinding(field, binding);

            var editorBinding = binding.Clone();

            var fieldBuilder = Form.GetFieldBuilder(field)
                               ?? new FieldConvention(EditorStrategies.Strategies);
            
            binding.ValidationRules.Add(new FieldInferenceRule(field, fieldBuilder, editorBinding));
        }