/// <summary>
        /// Occurs during the auto generation of the data form item.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Data form item event arguments.</param>
        private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (e.DataFormItem.Name.Equals("HasErrors"))
                {
                    e.Cancel = true;
                }
                else if (e.DataFormItem.Name.Equals("AccountNumber") || e.DataFormItem.Name.Equals("AccountNumber1"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email;
                }
                else if (e.DataFormItem.Name.Equals("Agree"))
                {
                    e.DataFormItem.LayoutOptions = LayoutType.Default;
                    (e.DataFormItem as DataFormCheckBoxItem).IsThreeState = false;
                    (e.DataFormItem as DataFormCheckBoxItem).Text         = "I agree to the Terms & Conditions";
                }

                if (!e.DataFormItem.Name.Equals("AccountType"))
                {
                    e.DataFormItem.TextInputLayoutSettings = new TextInputLayoutSettings()
                    {
                        ReserveSpaceForAssistiveLabels = true
                    };
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Raised to set read only property and cancel the some properties.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (!refreshLayout)
                {
                    if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName"))
                    {
                        e.Cancel = true;
                    }
                }

                if (e.DataFormItem.Name.Equals("ContactNumber"))
                {
                    (e.DataFormItem as DataFormTextItem).InputType = Android.Text.InputTypes.ClassNumber;
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).InputType = Android.Text.InputTypes.TextVariationEmailAddress;
                }
            }

            if (e.DataFormGroupItem != null)
            {
                e.DataFormGroupItem.AllowExpandCollapse = false;
            }
        }
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem.PropertyInfo.DeclaringType.Name != "ContactInfo")
     {
         e.Cancel = true;
     }
 }
Пример #4
0
        /// <summary>
        /// Event to cancel the COnatctImage DataFormItem and setting IsReadOnly property.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (!refreshLayout)
                {
                    if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName"))
                    {
                        e.Cancel = true;
                    }
                }

                if (e.DataFormItem.Name.Equals("ContactNumber"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoardType = UIKeyboardType.NumberPad;
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoardType = UIKeyboardType.EmailAddress;
                }
            }
            if (e.DataFormGroupItem != null)
            {
                e.DataFormGroupItem.AllowExpandCollapse = false;
            }
        }
Пример #5
0
        /// <summary>
        /// Raised to set read only property and cancel the some properties.
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Contains arguments of auto generating data form event</param>
        private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (!this.viewModel.RefreshLayout)
                {
                    if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName") || e.DataFormItem.Name.Equals("Notes"))
                    {
                        e.Cancel = true;
                    }
                }

                if (e.DataFormItem.Name.Equals("ContactNumber"))
                {
                    var dataFormMaskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    dataFormMaskedItem.KeyBoard          = Keyboard.Telephone;
                    dataFormMaskedItem.CutCopyMaskFormat = Syncfusion.XForms.MaskedEdit.MaskFormat.ExcludePromptAndLiterals;
                    dataFormMaskedItem.SkipLiterals      = true;
                    dataFormMaskedItem.ValueMaskFormat   = Syncfusion.XForms.MaskedEdit.MaskFormat.ExcludePromptAndLiterals;
                    e.DataFormItem.ImageSource           = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.DataForm_Phone.png");
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email;
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Email.png");
                }
                else if (e.DataFormItem.Name.Equals("ContactName"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.LabelContactName.png");
                }
                else if (e.DataFormItem.Name.Equals("ContactImage"))
                {
                    e.Cancel = true;
                }
                else if (e.DataFormItem.Name.Equals("BirthDate"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.BirthDate.png");
                }
                else if (e.DataFormItem.Name.Equals("GroupName"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Group.png");
                }
                else if (e.DataFormItem.Name.Equals("Address"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Address.png");
                }
                else if (e.DataFormItem.Name.Equals("Notes"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Notes.png");
                }

                this.ChangeItemOrder(e.DataFormItem);
            }

            if (e.DataFormGroupItem != null)
            {
                e.DataFormGroupItem.AllowExpandCollapse = false;
            }
        }
Пример #6
0
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null && e.DataFormItem.Name == "CityName")
     {
         (e.DataFormItem as DataFormPickerItem).DisplayMemberPath = "City";
         (e.DataFormItem as DataFormPickerItem).ValueMemberPath   = "PostalCode";
     }
 }
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name == "BirthYear")
         {
             (e.DataFormItem as DataFormNumericItem).EnableGroupSeparator = false;
         }
     }
 }
Пример #8
0
 private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name == "ConfirmPassword")
         {
             e.DataFormItem.IsVisible = false;
         }
     }
 }
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name == "Country")
         {
             (e.DataFormItem as DataFormDropDownItem).DisplayMemberPath = "Name";
             (e.DataFormItem as DataFormDropDownItem).SelectedValuePath = "Name";
         }
     }
 }
        /// <summary>
        /// Raised to set read only property and cancel the some properties.
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Contains arguments of auto generating data form event</param>
        private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (!this.viewModel.RefreshLayout)
                {
                    if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName") || e.DataFormItem.Name.Equals("Notes"))
                    {
                        e.Cancel = true;
                    }
                }

                if (e.DataFormItem.Name.Equals("ContactNumber"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Numeric;
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.DataForm_Phone.png");
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email;
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Email.png");
                }
                else if (e.DataFormItem.Name.Equals("ContactName"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.LabelContactName.png");
                }
                else if (e.DataFormItem.Name.Equals("ContactImage"))
                {
                    e.Cancel = true;
                }
                else if (e.DataFormItem.Name.Equals("BirthDate"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.BirthDate.png");
                }
                else if (e.DataFormItem.Name.Equals("GroupName"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Group.png");
                }
                else if (e.DataFormItem.Name.Equals("Address"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Address.png");
                }
                else if (e.DataFormItem.Name.Equals("Notes"))
                {
                    e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Notes.png");
                }
            }

            if (e.DataFormGroupItem != null)
            {
                e.DataFormGroupItem.AllowExpandCollapse = false;
            }
        }
Пример #11
0
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name == "CardNumber")
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask       = "0000-0000-0000-0000";
             maskedItem.PromptChar = 'X';
             maskedItem.KeyBoard   = Keyboard.Numeric;
         }
     }
 }
Пример #12
0
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (Device.RuntimePlatform != Device.UWP)
     {
         if (e.DataFormItem != null && e.DataFormItem.Name == "City")
         {
             var itemSource = ViewModel.GetPickerItems();
             (e.DataFormItem as DataFormPickerItem).DisplayMemberPath = "CityName";
             (e.DataFormItem as DataFormPickerItem).ValueMemberPath   = "CityName";
             (e.DataFormItem as DataFormPickerItem).ItemsSource       = itemSource;
         }
     }
 }
        private void AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (Command == null)
            {
                return;
            }

            var parameter = e;

            if (Command.CanExecute(parameter))
            {
                Command.Execute(parameter);
            }
        }
 /// <summary>
 /// Occurs during the auto generation of the data form item.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">Data form item event arguments.</param>
 private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("Gender"))
         {
             e.DataFormItem.LayoutOptions = LayoutType.Default;
         }
         else if (e.DataFormItem.Name.Equals("MaritalStatus"))
         {
             e.DataFormItem.LayoutOptions = LayoutType.Default;
         }
     }
 }
Пример #15
0
        void Bindable_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (Command == null)
            {
                return;
            }

            object parameter = Converter.Convert(e, typeof(object), null, null);

            if (Command.CanExecute(parameter))
            {
                Command.Execute(parameter);
            }
        }
 private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("HasErrors"))
         {
             e.Cancel = true;
         }
         else if (e.DataFormItem.Name == "Reminder")
         {
             e.DataFormItem.LayoutOptions = LayoutType.Default;
         }
     }
 }
Пример #17
0
        public void AutoGenerateColumns(object autoGeneratingDataFormItemEventArgs)
        {
            AutoGeneratingDataFormItemEventArgs e = autoGeneratingDataFormItemEventArgs as AutoGeneratingDataFormItemEventArgs;

            if (e.DataFormItem != null && e.DataFormItem.Name == "Date")
            {
                (e.DataFormItem as DataFormDateItem).MinimumDate = new DateTime(2018, 1, 1);
                (e.DataFormItem as DataFormDateItem).MaximumDate = new DateTime(2018, 3, 31);
            }

            if (e.DataFormItem != null && e.DataFormItem.Name == "Spent")
            {
                (e.DataFormItem as DataFormNumericItem).FormatString = "c";
            }
        }
Пример #18
0
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem.Name == "Email")
            {
                e.DataFormItem.ImageSource = ImageSource.FromFile("ic_action_person.png");
            }

            if (e.DataFormItem.Name == "Password")
            {
                e.DataFormItem.ImageSource = ImageSource.FromFile("ic_action_map.png");
            }

            if (e.DataFormItem.Name == "RememberMe")
            {
                e.DataFormItem.Editor = "Switch";
            }
        }
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("AccountNumber") || e.DataFormItem.Name.Equals("AccountNumber1"))
         {
             (e.DataFormItem as DataFormTextItem).KeyBoardType = UIKeyboardType.NumberPad;
         }
         else if (e.DataFormItem.Name.Equals("Email"))
         {
             (e.DataFormItem as DataFormTextItem).KeyBoardType = UIKeyboardType.EmailAddress;
         }
         else if (e.DataFormItem.Name.Equals("SWIFT"))
         {
             (e.DataFormItem as DataFormTextItem).AutocapitalizationType = UITextAutocapitalizationType.AllCharacters;
         }
     }
 }
Пример #20
0
 private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("HasErrors"))
         {
             e.Cancel = true;
         }
         else if (e.DataFormItem.Name.Equals("AccountNumber") || e.DataFormItem.Name.Equals("AccountNumber1"))
         {
             (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("Email"))
         {
             (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email;
         }
     }
 }
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("AccountNumber") || e.DataFormItem.Name.Equals("AccountNumber1"))
         {
             (e.DataFormItem as DataFormTextItem).InputType = Android.Text.InputTypes.ClassNumber;
         }
         else if (e.DataFormItem.Name.Equals("Email"))
         {
             (e.DataFormItem as DataFormTextItem).InputType = Android.Text.InputTypes.TextVariationEmailAddress;
         }
         else if (e.DataFormItem.Name.Equals("SWIFT"))
         {
             (e.DataFormItem as DataFormTextItem).InputType = Android.Text.InputTypes.TextFlagCapCharacters;
         }
     }
 }
Пример #22
0
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null && e.DataFormItem.Name == "TipoTramite")
            {
                (e.DataFormItem as DataFormPickerItem).DisplayMemberPath = "Nombre";
                (e.DataFormItem as DataFormPickerItem).ValueMemberPath   = "Id";
                e.DataFormItem.ShowLabel = false;
            }

            if (e.DataFormGroupItem != null && e.DataFormGroupItem.GroupName == "Documentos")
            {
                e.DataFormGroupItem.IsExpanded = false;
            }

            if (e.DataFormGroupItem != null && e.DataFormGroupItem.GroupName == "Pago")
            {
                e.DataFormGroupItem.IsExpanded = false;
            }
        }
Пример #23
0
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null && e.DataFormItem.Name == "TipoTramite")
            {
                (e.DataFormItem as DataFormPickerItem).DisplayMemberPath = "Name";
                (e.DataFormItem as DataFormPickerItem).ValueMemberPath   = "Value";
                e.DataFormItem.ShowLabel = false;
            }

            if (e.DataFormGroupItem != null && e.DataFormGroupItem.GroupName == MessageCenter.appGroupName2DFTramite)
            {
                e.DataFormGroupItem.IsExpanded = false;
                //buttonDoc.IsVisible = false;
            }

            if (e.DataFormGroupItem != null && e.DataFormGroupItem.GroupName == MessageCenter.appGroupName3DFTramite)
            {
                e.DataFormGroupItem.IsExpanded = false;
            }
        }
Пример #24
0
 /// <summary>
 /// Raised to set read only property and cancel the some properties.
 /// </summary>
 /// <param name="sender">Sender object</param>
 /// <param name="e">Contains arguments of auto generating data form event</param>
 private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("PhoneNumber"))
         {
             e.DataFormItem.TextInputLayoutSettings = new Syncfusion.SfDataForm.XForms.TextInputLayoutSettings()
             {
                 OutlineCornerRadius            = 30,
                 ReserveSpaceForAssistiveLabels = true
             };
         }
         else if (e.DataFormItem.Name.Equals("Address"))
         {
             e.DataFormItem.TextInputLayoutSettings = new Syncfusion.SfDataForm.XForms.TextInputLayoutSettings()
             {
                 ContainerType = ContainerType.None
             };
         }
     }
 }
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            var name = e.DataFormItem.Name;

            switch (name)
            {
            case "Email":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "Email", Editor = "Text", PlaceHolderText = "Enter Email", KeyBoard = Keyboard.Email
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway", "Assets/Fonts/RALEWAY-LIGHT.TTF#Raleway"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto-Mono", "Assets/Fonts/RobotoMono-Bold.ttf#Roboto-Mono")
                };

                break;

            case "Password":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "Password", Editor = "Password", PlaceHolderText = "Enter Password", KeyBoard = Keyboard.Text
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway", "Assets/Fonts/RALEWAY-LIGHT.TTF#Raleway"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto-Mono", "Assets/Fonts/RobotoMono-Bold.ttf#Roboto-Mono")
                };
                break;
            }
        }
Пример #26
0
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         e.DataFormItem.TextInputLayoutSettings = new TextInputLayoutSettings()
         {
             OutlineCornerRadius = 25
         };
     }
     if (e.DataFormItem != null && e.DataFormItem.Name == "MaxPushUps")
     {
         (e.DataFormItem as DataFormNumericUpDownItem).Maximum     = 60;
         (e.DataFormItem as DataFormNumericUpDownItem).Minimum     = 0;
         (e.DataFormItem as DataFormNumericUpDownItem).AutoReverse = true;
     }
     if (e.DataFormItem != null && e.DataFormItem.Name == "MaxSquats")
     {
         (e.DataFormItem as DataFormNumericUpDownItem).Maximum     = 200;
         (e.DataFormItem as DataFormNumericUpDownItem).Minimum     = 0;
         (e.DataFormItem as DataFormNumericUpDownItem).AutoReverse = true;
     }
     if (e.DataFormItem != null && e.DataFormItem.Name == "MaxPullUps")
     {
         (e.DataFormItem as DataFormNumericUpDownItem).Maximum     = 20;
         (e.DataFormItem as DataFormNumericUpDownItem).Minimum     = 0;
         (e.DataFormItem as DataFormNumericUpDownItem).AutoReverse = true;
     }
     if (e.DataFormItem != null && e.DataFormItem.Name == "Weight")
     {
         (e.DataFormItem as DataFormNumericUpDownItem).Maximum = 150;
         (e.DataFormItem as DataFormNumericUpDownItem).Minimum = 0;
     }
     if (e.DataFormItem != null && e.DataFormItem.Name == "Height")
     {
         (e.DataFormItem as DataFormNumericUpDownItem).Maximum = 220;
         (e.DataFormItem as DataFormNumericUpDownItem).Minimum = 0;
     }
 }
        /// <summary>
        /// Occurs during the auto generation of the data form item.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Data form item event arguments.</param>
        private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (e.DataFormItem.Name.Equals("HasErrors"))
                {
                    e.Cancel = true;
                }
                else if (e.DataFormItem.Name.Equals("AccountNumber") || e.DataFormItem.Name.Equals("AccountNumber1"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("Email"))
                {
                    (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email;
                }

                if (e.DataFormItem.Name.Equals("Agree"))
                {
                    (e.DataFormItem as DataFormCheckBoxItem).IsThreeState = false;
                    (e.DataFormItem as DataFormCheckBoxItem).Text         = "I agree to the Terms & Conditions";
                }
            }
        }
Пример #28
0
        public void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            var name = e.DataFormItem.Name;

            switch (name)
            {
            case "FirstName":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "FirstName", Editor = "Text", PlaceHolderText = "Enter your firstname", KeyBoard = Keyboard.Email, LabelText = "Firstname"
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "LastName":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "LastName", Editor = "Text", PlaceHolderText = "Enter your lastname", KeyBoard = Keyboard.Email, LabelText = "Lastname"
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "Nationality":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "Nationality", Editor = "Text", PlaceHolderText = "Enter your nationality", KeyBoard = Keyboard.Email
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "BirthDate":
                e.DataFormItem.LabelText = "Date of birth";
                e.DataFormItem.Editor    = "Date";
                (e.DataFormItem as DataFormDateItem).Format      = "dd/MM/yyyy";
                (e.DataFormItem as DataFormDateItem).MaximumDate = DateTime.Now;
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "Email":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "Email", Editor = "Text", PlaceHolderText = "Enter Email", KeyBoard = Keyboard.Email
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "Password":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "Password", Editor = "Password", PlaceHolderText = "Enter Password", KeyBoard = Keyboard.Text
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;

            case "PasswordRepeat":
                e.DataFormItem = new DataFormTextItem()
                {
                    Name = "PasswordRepeat", Editor = "Password", PlaceHolderText = "Enter Password", KeyBoard = Keyboard.Text, LabelText = "Repeat password"
                };
                e.DataFormItem.HintLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-Light.ttf", "Raleway-Light.ttf#Raleway Light", "/Assets/Fonts/Raleway-Light.ttf#Raleway Light"), FontSize = 16
                };
                e.DataFormItem.HelperLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("RobotoMono-Bold.ttf", "RobotoMono-Bold.ttf#Roboto Mono", "/Assets/Fonts/ROBOTOMONO-BOLD.TTF#Roboto Mono")
                };
                e.DataFormItem.ValidationLabelStyle = new LabelStyle()
                {
                    FontFamily = Device.OnPlatform("Raleway-ExtraLight.ttf", "Raleway-ExtraLight.ttf#Raleway ExtraLight", "/Assets/Fonts/Raleway-ExtraLight.ttf#Raleway ExtraLight")
                };
                break;
            }
        }
Пример #29
0
 /// <summary>
 /// Occurs during the auto generation of the data form item.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">Data form item event arguments.</param>
 private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
 {
     if (e.DataFormItem != null)
     {
         if (e.DataFormItem.Name.Equals("Team"))
         {
             e.DataFormItem.LayoutOptions = LayoutType.Default;
         }
         else if (e.DataFormItem.Name.Equals("Trackhours"))
         {
             e.DataFormItem.LayoutOptions = LayoutType.Default;
         }
         else if (e.DataFormItem.Name.Equals("CCV"))
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask       = "000";
             maskedItem.PromptChar = '*';
             maskedItem.KeyBoard   = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("CardNumber"))
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask     = "0000-0000-0000-0000";
             maskedItem.KeyBoard = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("ExpirationDate"))
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask     = "00/00";
             maskedItem.KeyBoard = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("Zip1") || e.DataFormItem.Name.Equals("Zip") || e.DataFormItem.Name.Equals("ZipCode"))
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask       = "000000";
             maskedItem.PromptChar = '_';
             maskedItem.KeyBoard   = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("Code"))
         {
             var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
             maskedItem.Mask       = "000";
             maskedItem.PromptChar = '_';
             maskedItem.KeyBoard   = Keyboard.Numeric;
         }
         else if (e.DataFormItem.Name.Equals("PhoneNumber") || e.DataFormItem.Name.Equals("Phone"))
         {
             var item = (e.DataFormItem as DataFormMaskedEditTextItem);
             item.Mask     = "+(00)0000000000";
             item.KeyBoard = Keyboard.Telephone;
         }
         else if (e.DataFormItem.Name.Equals("ContactEmail"))
         {
             var textItem = e.DataFormItem as DataFormTextItem;
             textItem.KeyBoard = Keyboard.Email;
         }
         e.DataFormItem.TextInputLayoutSettings = new Syncfusion.SfDataForm.XForms.TextInputLayoutSettings()
         {
             OutlineCornerRadius = 30
         };
     }
 }
Пример #30
0
        /// <summary>
        /// Occurs during the auto generation of the data form item.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Data form item event arguments.</param>
        private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (e.DataFormItem.Name.Equals("Trackhours"))
                {
                    e.DataFormItem.LayoutOptions = LayoutType.Default;
                }
                else if (e.DataFormItem.Name.Equals("CCV"))
                {
                    var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    maskedItem.Mask       = "000";
                    maskedItem.PromptChar = '*';
                    maskedItem.KeyBoard   = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("CardNumber"))
                {
                    var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    maskedItem.Mask     = "0000-0000-0000-0000";
                    maskedItem.KeyBoard = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("ExpirationDate"))
                {
                    var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    maskedItem.Mask     = "00/00";
                    maskedItem.KeyBoard = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("EmployeeZip") || e.DataFormItem.Name.Equals("Zip") || e.DataFormItem.Name.Equals("ZipCode"))
                {
                    var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    maskedItem.Mask       = "000000";
                    maskedItem.PromptChar = '_';
                    maskedItem.KeyBoard   = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("Code"))
                {
                    var maskedItem = e.DataFormItem as DataFormMaskedEditTextItem;
                    maskedItem.Mask       = "000";
                    maskedItem.PromptChar = '_';
                    maskedItem.KeyBoard   = Keyboard.Numeric;
                }
                else if (e.DataFormItem.Name.Equals("PhoneNumber") || e.DataFormItem.Name.Equals("Phone"))
                {
                    var item = (e.DataFormItem as DataFormMaskedEditTextItem);
                    item.Mask     = "+(00)0000000000";
                    item.KeyBoard = Keyboard.Telephone;
                }
                else if (e.DataFormItem.Name.Equals("ContactEmail"))
                {
                    var textItem = e.DataFormItem as DataFormTextItem;
                    textItem.KeyBoard = Keyboard.Email;
                }
                else if (e.DataFormItem.Name.Equals("Country") || e.DataFormItem.Name.Equals("EcommerceCountry") || e.DataFormItem.Name.Equals("OrganizationCountry"))
                {
                    var autoCompleteItem = e.DataFormItem as DataFormAutoCompleteItem;
                    autoCompleteItem.TextHighlightMode    = Syncfusion.XForms.DataForm.OccurrenceMode.FirstOccurrence;
                    autoCompleteItem.HighlightedTextColor = Color.Red;
                }


                if (this.dataForm.DataObject is EmployeeForm)
                {
                    e.DataFormItem.TextInputLayoutSettings = new TextInputLayoutSettings()
                    {
                        OutlineCornerRadius            = 30,
                        ReserveSpaceForAssistiveLabels = false,
                        ShowHelperText = false,
                    };
                    e.DataFormItem.HintLabelStyle = new LabelStyle()
                    {
                        FontSize = 18
                    };
                }
                else
                {
                    e.DataFormItem.TextInputLayoutSettings = new TextInputLayoutSettings()
                    {
                        ReserveSpaceForAssistiveLabels = false,
                        ShowHelperText = false
                    };
                }

                if (e.DataFormItem.Name.Equals("OrganizationName") || e.DataFormItem.Name.Equals("AddressLine1") || e.DataFormItem.Name.Equals("AddressLine2") || (e.DataFormItem.Name.Equals("ContactEmail") || (e.DataFormItem.Name.Equals("OrganizationCountry"))))
                {
                    e.DataFormItem.ColumnSpan = 4;
                }
            }
        }