Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DisplayFieldViewModel"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="parentField">The parent field.</param>
        public DisplayFieldViewModel(FieldInfo model, IDisplayFieldViewModel parentField)
        {
            Model = model;
            ParentFieldViewModel = parentField;
            ParentStepViewModel = parentField.ParentStepViewModel;

            if (Model != null && ParentStepViewModel != null)
            {
                _isSelected = ParentStepViewModel.ContainsSelectedField(FullSystemPath);
            }
        }
        public void SelectDisplayField(IDisplayFieldViewModel fieldViewModel)
        {
            var path = fieldViewModel.FullSystemPath;

            if (ContainsSelectedField(path))
            {
                return;
            }

            var maxOrder = 0.0;

            if (this.ViewConfigurator.ExistingRecordFields.Any())
            {
                maxOrder = this.ViewConfigurator.ExistingRecordFields.Max(x => x.Order);
            }

            var newField = new DisplayField(fieldViewModel.FullPath, fieldViewModel.FullSystemPath, maxOrder + 1.0, fieldViewModel.Model.IsBuiltIn);
            this.ViewConfigurator.ExistingRecordFields.Add(newField);

            var vm = new SelectedFieldViewModel();
            vm.Initialize(newField, this);
            this.SelectedDisplayFields.Add(vm);

            this.UpdateCanMoveFields();
        }
 /// <summary>
 /// Selects the display field.
 /// </summary>
 /// <param name="displayFieldViewModel">The display field view model.</param>
 public void SelectDisplayField(IDisplayFieldViewModel displayFieldViewModel)
 {
 }