/// <summary> /// Select A field from the field list. /// </summary> /// <param name="fieldViewModel">Selected field.</param> public void SelectDisplayField(ISelectorFieldViewModel fieldViewModel) { var path = fieldViewModel.SystemName; if (SelectedFields.Contains(path + ",")) { return; } var maxOrder = 0.0; if (!string.IsNullOrEmpty(SelectedFields)) maxOrder = SelectedFields.Split(',').Length; SelectedFields += path + ","; if (string.IsNullOrEmpty(ParentModel.Model.HeaderDisplayFields)) ParentModel.Model.HeaderDisplayFields = fieldViewModel.Name; else ParentModel.Model.HeaderDisplayFields += ", " + fieldViewModel.Name; var field = new CrossRefFieldEdit(); field.FieldName = fieldViewModel.Name; field.FullPath = fieldViewModel.SystemName; field.Order = maxOrder + 1.0; field.FieldGuid = fieldViewModel.Model.Guid; var vm = new SelectedFieldViewModel(); vm.Initialize(field, this); SelectedDisplayFields.Add(vm); UpdateCanMoveFields(); }