protected override IEnumerable <PageControlBase> CreateItems() { var pageControl = new PageControl(SourceExpr, ID, GetIndentation()); #if NAV2015 pageControl.Properties.AccessByPermission.Set(AccessByPermission); #endif #if NAV2017 pageControl.Properties.ApplicationArea.Set(ApplicationArea); #endif pageControl.Properties.AssistEdit = NullableBooleanFromSwitch(nameof(AssistEdit)); pageControl.Properties.AutoFormatExpr = AutoFormatExpr; pageControl.Properties.AutoFormatType = AutoFormatType; pageControl.Properties.BlankNumbers = BlankNumbers; pageControl.Properties.BlankZero = NullableBooleanFromSwitch(nameof(BlankZero)); pageControl.Properties.CaptionClass = CaptionClass; pageControl.Properties.CaptionML.Set(CaptionML); pageControl.Properties.CharAllowed = CharAllowed; pageControl.Properties.ClosingDates = NullableBooleanFromSwitch(nameof(ClosingDates)); pageControl.Properties.ColumnSpan = ColumnSpan; pageControl.Properties.ControlAddIn = ControlAddIn; pageControl.Properties.DateFormula = NullableBooleanFromSwitch(nameof(DateFormula)); pageControl.Properties.DecimalPlaces.AtLeast = DecimalPlacesAtLeast; pageControl.Properties.DecimalPlaces.AtMost = DecimalPlacesAtMost; pageControl.Properties.Description = Description; pageControl.Properties.DrillDown = NullableBooleanFromSwitch(nameof(DrillDown)); pageControl.Properties.DrillDownPageID = DrillDownPageID; pageControl.Properties.Editable = Editable; pageControl.Properties.Enabled = Enabled; pageControl.Properties.ExtendedDatatype = ExtendedDataType; pageControl.Properties.HideValue = HideValue; #if NAV2015 pageControl.Properties.Image = Image; #endif pageControl.Properties.Importance = Importance; pageControl.Properties.Lookup = NullableBooleanFromSwitch(nameof(Lookup)); pageControl.Properties.LookupPageID = LookupPageID; pageControl.Properties.MaxValue = MaxValue; pageControl.Properties.MinValue = MinValue; pageControl.Properties.MultiLine = NullableBooleanFromSwitch(nameof(MultiLine)); pageControl.Properties.Name = Name; pageControl.Properties.NotBlank = NullableBooleanFromSwitch(nameof(NotBlank)); pageControl.Properties.Numeric = NullableBooleanFromSwitch(nameof(Numeric)); #if NAV2018 pageControl.Properties.ODataEDMType = ODataEdmType; #endif pageControl.Properties.OnAssistEdit.Set(OnAssistEdit); pageControl.Properties.OnControlAddIn.Set(OnControlAddIn); pageControl.Properties.OnDrillDown.Set(OnDrillDown); pageControl.Properties.OnLookup.Set(OnLookup); pageControl.Properties.OnValidate.Set(OnValidate); pageControl.Properties.OptionCaptionML.Set(OptionCaptionML); pageControl.Properties.QuickEntry = QuickEntry; pageControl.Properties.RowSpan = RowSpan; pageControl.Properties.ShowCaption = NullableBooleanFromSwitch(nameof(ShowCaption)); #if NAV2015 pageControl.Properties.ShowMandatory = ShowMandatory; #endif pageControl.Properties.Style = Style; pageControl.Properties.StyleExpr = StyleExpr; pageControl.Properties.Title = NullableBooleanFromSwitch(nameof(Title)); pageControl.Properties.ToolTipML.Set(ToolTipML); pageControl.Properties.ValuesAllowed = ValuesAllowed; pageControl.Properties.Visible = Visible; pageControl.Properties.Width = Width; pageControl.AutoCaption(AutoCaption); if (SubObjects != null) { var subObjects = SubObjects.Invoke().Select(o => o.BaseObject); pageControl.Properties.TableRelation.AddRange(subObjects.OfType <TableRelationLine>()); } yield return(pageControl); }