Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 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
 }
Ejemplo n.º 4
0
 public override void UpdateEditor(TKDataForm dataForm, TKDataFormEditor editor, TKEntityProperty property)
 {
     if (property.Name == "age")
     {
         TKGridLayoutCellDefinition labelDef = editor.GridLayout.DefinitionForView(((TKDataFormStepperEditor)editor).ValueLabel);
         labelDef.ContentOffset = new UIOffset(-25, 0);
     }
 }
Ejemplo n.º 5
0
        public CallEditor()
        {
            this.ActionButton = new UIButton();
            this.ActionButton.SetTitle("Call", UIControlState.Normal);
            this.ActionButton.SetTitleColor(new UIColor(0.780f, 0.2f, 0.233f, 1.0f), UIControlState.Normal);
            this.AddSubview(this.ActionButton);
            this.GridLayout.AddArrangedView(this.ActionButton);
            TKGridLayoutCellDefinition btnDef = this.GridLayout.DefinitionForView(this.ActionButton);

            btnDef.Row    = new NSNumber(0);
            btnDef.Column = new NSNumber(3);
            this.GridLayout.SetWidth(this.ActionButton.SizeThatFits(new CGSize()).Width, 3);
        }
Ejemplo n.º 6
0
        public override void UpdateEditor(TKDataForm dataForm, TKDataFormEditor editor, TKEntityProperty property)
        {
            editor.Style.TextLabelOffset       = new UIOffset(10, 0);
            editor.Style.SeparatorLeadingSpace = 40;
            editor.Style.AccessoryArrowStroke  = new TKStroke(new UIColor(0.780f, 0.2f, 0.233f, 1.0f));
            List <string> properties = new List <string> ()
            {
                "Origin", "Date", "Time", "Name", "Phone"
            };

            if (properties.Contains(property.Name))
            {
                editor.Style.TextLabelDisplayMode = TKDataFormEditorTextLabelDisplayMode.Hidden;
                TKGridLayoutCellDefinition titleDef = editor.GridLayout.DefinitionForView(editor.TextLabel);
                editor.GridLayout.SetWidth(0, titleDef.Column.Int32Value);
                editor.Style.EditorOffset = new UIOffset(10, 0);
            }

            if (property.Name == "Origin")
            {
                editor.Style.EditorOffset   = new UIOffset(0, 0);
                editor.Style.SeparatorColor = null;
            }

            if (property.Name == "Name")
            {
                editor.Style.FeedbackLabelOffset = new UIOffset(10, 0);
                editor.FeedbackLabel.Font        = UIFont.ItalicSystemFontOfSize(10);
            }

            if (property.Name == "Guests")
            {
                TKGridLayoutCellDefinition labelDef = editor.GridLayout.DefinitionForView(((TKDataFormStepperEditor)editor).ValueLabel);
                labelDef.ContentOffset = new UIOffset(-25, 0);
            }

            if (property.Name == "Section")
            {
                UIImage img = new UIImage("guest-name.png");
                editor.Style.TextLabelOffset = new UIOffset(img.Size.Width + 10, 0);
            }

            if (property.Name == "Table" || property.Name == "Section")
            {
                editor.TextLabel.TextColor = UIColor.White;
                editor.BackgroundColor     = UIColor.Clear;
                ((TKDataFormOptionsEditor)editor).SelectedOptionLabel.TextColor     = UIColor.White;
                ((TKDataFormOptionsEditor)editor).SelectedOptionLabel.TextAlignment = UITextAlignment.Right;
                editor.Style.EditorOffset = new UIOffset(-10, 0);
            }
        }
Ejemplo n.º 7
0
            public override void UpdateEditor(TKDataForm dataForm, TKDataFormEditor editor, TKEntityProperty property)
            {
                List <string> properties = new List <string> ()
                {
                    "FirstName", "LastName", "CardNumber"
                };

                if (properties.Contains(property.Name))
                {
                    editor.Style.TextLabelDisplayMode = TKDataFormEditorTextLabelDisplayMode.Hidden;
                    TKGridLayoutCellDefinition titleDef = editor.GridLayout.DefinitionForView(editor.TextLabel);
                    editor.GridLayout.SetWidth(0, titleDef.Column.Int32Value);
                }
            }
Ejemplo n.º 8
0
        public override void UpdateEditor(TKDataForm dataForm, TKDataFormEditor editor, TKEntityProperty property)
        {
            TKGridLayoutCellDefinition feedbackDef = editor.GridLayout.DefinitionForView(editor.FeedbackLabel);

            editor.GridLayout.SetHeight(0, feedbackDef.Row.Int32Value);

            if (property.Name == "InfoProtocol")
            {
                editor.Style.TextLabelDisplayMode = TKDataFormEditorTextLabelDisplayMode.Hidden;
                TKGridLayoutCellDefinition textLabelDef = editor.GridLayout.DefinitionForView(editor.TextLabel);
                editor.GridLayout.SetWidth(0, textLabelDef.Column.Int32Value);
            }

            if (editor.IsKindOfClass(new Class(typeof(TKDataFormTextFieldEditor))) && !(property.Name.Equals("Password")))
            {
                property.HintText = "Required";
            }
        }
Ejemplo n.º 9
0
            // << dataform-validate-cs

            public override void UpdateEditor(TKDataForm dataForm, TKDataFormEditor editor, TKEntityProperty property)
            {
                List <string> properties = new List <string> ()
                {
                    "Email", "Password", "RepeatPassword", "Name"
                };

                if (properties.Contains(property.Name))
                {
                    editor.Style.TextLabelDisplayMode = TKDataFormEditorTextLabelDisplayMode.Hidden;
                    TKGridLayoutCellDefinition titleDef = editor.GridLayout.DefinitionForView(editor.TextLabel);
                    editor.GridLayout.SetWidth(0, titleDef.Column.Int32Value);
                }

                if (!property.IsValid)
                {
                    editor.Style.Fill = new TKSolidFill(new UIColor(1, 0, 0, 0.3f));
                }
                else
                {
                    editor.Style.Fill = new TKSolidFill(UIColor.Clear);
                }
            }