示例#1
0
        private void PerformTopAlignmentSettingsForEditor(TKDataFormEditor editor, TKEntityProperty property)
        {
            editor.Style.SeparatorColor = null;
            editor.TextLabel.Font       = UIFont.SystemFontOfSize(15);
            editor.Style.Insets         = new UIEdgeInsets(1, editor.Style.Insets.Left, 5, editor.Style.Insets.Right);

            if (property.Name != "Gender")
            {
                TKGridLayout gridLayout = editor.GridLayout;
                TKGridLayoutCellDefinition editorDef = gridLayout.DefinitionForView(editor.Editor);
                if (editorDef != null)
                {
                    editorDef.Row    = new NSNumber(1);
                    editorDef.Column = new NSNumber(1);
                }

                if (property.Name == "DateOfBirth")
                {
                    TKDataFormDatePickerEditor dateEditor = (TKDataFormDatePickerEditor)editor;
                    TKGridLayoutCellDefinition labelDef   = gridLayout.DefinitionForView(dateEditor.EditorValueLabel);
                    labelDef.Row    = new NSNumber(1);
                    labelDef.Column = new NSNumber(1);
                }

                TKGridLayoutCellDefinition feedbackDef = editor.GridLayout.DefinitionForView(editor.FeedbackLabel);
                feedbackDef.Row        = new NSNumber(2);
                feedbackDef.Column     = new NSNumber(1);
                feedbackDef.ColumnSpan = 1;

                this.SetEditorStyle(editor);
            }
        }
示例#2
0
        private void PerformTopInlineAlignmentSettingsForEditor(TKDataFormEditor editor, TKEntityProperty property)
        {
            editor.Style.SeparatorColor = null;
            editor.Style.Insets         = new UIEdgeInsets(6, editor.Style.Insets.Left, 6, editor.Style.Insets.Right);

            TKGridLayout gridLayout = editor.GridLayout;

            this.SetEditorStyle(editor);

            if (property.Name == "DateOfBirth")
            {
                TKDataFormDatePickerEditor dateEditor = (TKDataFormDatePickerEditor)editor;
                TKGridLayoutCellDefinition labelDef   = gridLayout.DefinitionForView(dateEditor.EditorValueLabel);
                labelDef.Row    = new NSNumber(1);
                labelDef.Column = new NSNumber(1);
                gridLayout.SetHeight(44, labelDef.Row.Int32Value);

                TKGridLayoutCellDefinition feedbackDef = editor.GridLayout.DefinitionForView(editor.FeedbackLabel);
                feedbackDef.Row        = new NSNumber(2);
                feedbackDef.Column     = new NSNumber(1);
                feedbackDef.ColumnSpan = 1;
            }

            if (editor.IsKindOfClass(new Class(typeof(TKDataFormTextFieldEditor))))
            {
                editor.Style.TextLabelDisplayMode = TKDataFormEditorTextLabelDisplayMode.Hidden;
                TKGridLayoutCellDefinition titleDef = editor.GridLayout.DefinitionForView(editor.TextLabel);
                gridLayout.SetWidth(0, titleDef.Column.Int32Value);
            }
        }
示例#3
0
 public override void UpdateGroupView(TKDataForm dataForm, TKEntityPropertyGroupView groupView, uint groupIndex)
 {
     // >> dataform-groups-layout-cs
     groupView.Collapsible = true;
     if (groupIndex == 0)
     {
         TKGridLayout grid = new TKGridLayout();
         groupView.EditorsContainer.Layout = grid;
         int row = 0;
         int col = 0;
         foreach (UIView editor in groupView.EditorsContainer.Items)
         {
             TKGridLayoutCellDefinition editorDefinition = grid.DefinitionForView(editor);
             editorDefinition.Row    = new NSNumber(row);
             editorDefinition.Column = new NSNumber(col);
             col++;
             if (col == 2)
             {
                 row++;
                 col = 0;
             }
         }
     }
     // << dataform-groups-layout-cs
 }