public object Create(PropertyInfo propertyInfo) { maskededit = new SfMaskedEdit(); maskededit.MaskType = MaskType.RegEx; maskededit.Mask = "[A-Za-z0-9._%-]+@[A-Za-z0-9]+.[A-Za-z]{2,3}"; return(maskededit); }
public Performance() { label = new UILabel(); label1 = new UILabel(); label2 = new UILabel(); label3 = new UILabel(); button = new UIButton(UIButtonType.System); textBox1 = new SfMaskedEdit(); textBox2 = new SfMaskedEdit(); importCheck = new SfCheckBox(); button.TouchUpInside += OnButtonClicked; }
public View GetSampleContent(Context con) { context = con; InitialMethod(); ScrollView scroll = new ScrollView(con); bool isTablet = SfMaskedEditText.IsTabletDevice(con); linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(12, 12, 12, 12); TextView headLabel = new TextView(con); headLabel.TextSize = 30; headLabel.SetTextColor(Color.ParseColor("#262626")); headLabel.Typeface = Typeface.DefaultBold; headLabel.Text = "Funds Transfer"; linear.AddView(headLabel); TextView fundTransferLabelSpacing = new TextView(con); fundTransferLabelSpacing.SetHeight(40); linear.AddView(fundTransferLabelSpacing); TextView textToAccount = new TextView(con); textToAccount.SetTextColor(Color.ParseColor("#6d6d72")); textToAccount.TextSize = 18; textToAccount.Typeface = Typeface.Default; textToAccount.Text = "To Account"; textToAccount.SetPadding(0, 0, 0, 10); linear.AddView(textToAccount); sfToAccount = new SfMaskedEdit(con); sfToAccount.Mask = "0000 0000 0000 0000"; sfToAccount.Gravity = GravityFlags.Start; sfToAccount.ValidationMode = InputValidationMode.KeyPress; sfToAccount.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfToAccount.Hint = "1234 1234 1234 1234"; sfToAccount.FocusChange += SfToAccount_FocusChange; sfToAccount.SetHintTextColor(Color.LightGray); linear.AddView(sfToAccount); erroToAccount = new TextView(con); erroToAccount.SetTextColor(Color.Red); erroToAccount.TextSize = 14; erroToAccount.Typeface = Typeface.Default; linear.AddView(erroToAccount); TextView textDesc = new TextView(con); textDesc.Text = "Description"; textDesc.Typeface = Typeface.Default; textDesc.SetPadding(0, 30, 0, 10); textDesc.TextSize = 18; linear.AddView(textDesc); sfDesc = new SfMaskedEdit(con); sfDesc.Mask = ""; sfDesc.Gravity = GravityFlags.Start; sfDesc.ValidationMode = InputValidationMode.KeyPress; sfDesc.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfDesc.Hint = "Enter description"; sfDesc.FocusChange += SfToAccount_FocusChange; sfDesc.SetHintTextColor(Color.LightGray); linear.AddView(sfDesc); TextView textAmount = new TextView(con); textAmount.Text = "Amount"; textAmount.Typeface = Typeface.Default; textAmount.SetPadding(0, 30, 0, 10); textAmount.TextSize = 18; linear.AddView(textAmount); amountMask = new SfMaskedEdit(con); amountMask.Mask = "$ 0,000.00"; amountMask.Gravity = GravityFlags.Start; amountMask.ValidationMode = InputValidationMode.KeyPress; amountMask.ValueMaskFormat = MaskFormat.IncludePromptAndLiterals; amountMask.Hint = "$ 3,874.00"; amountMask.FocusChange += SfToAccount_FocusChange; amountMask.SetHintTextColor(Color.LightGray); linear.AddView(amountMask); errotextAmount = new TextView(con); errotextAmount.SetTextColor(Color.Red); errotextAmount.TextSize = 12; errotextAmount.Typeface = Typeface.Default; linear.AddView(errotextAmount); TextView textEmail = new TextView(con); textEmail.Text = "Email ID"; textEmail.Typeface = Typeface.Default; textEmail.SetPadding(0, 30, 0, 10); textEmail.TextSize = 18; linear.AddView(textEmail); emailMask = new SfMaskedEdit(con); emailMask.Mask = @"\w+@\w+\.\w+"; emailMask.MaskType = MaskType.RegEx; emailMask.Gravity = GravityFlags.Start; emailMask.ValidationMode = InputValidationMode.KeyPress; emailMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; emailMask.Hint = "*****@*****.**"; emailMask.FocusChange += SfToAccount_FocusChange; emailMask.SetHintTextColor(Color.LightGray); linear.AddView(emailMask); errotextEmail = new TextView(con); errotextEmail.SetTextColor(Color.Red); errotextEmail.TextSize = 12; errotextEmail.Typeface = Typeface.Default; linear.AddView(errotextEmail); TextView textPhone = new TextView(con); textPhone.Text = "Mobile Number "; textPhone.Typeface = Typeface.Default; textPhone.SetPadding(0, 30, 0, 10); textPhone.TextSize = 18; linear.AddView(textPhone); phoneMask = new SfMaskedEdit(con); phoneMask.Mask = "+1 000 000 0000"; phoneMask.Gravity = GravityFlags.Start; phoneMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; phoneMask.ValidationMode = InputValidationMode.KeyPress; phoneMask.Hint = "+1 323 339 3392"; phoneMask.FocusChange += SfToAccount_FocusChange; phoneMask.SetHintTextColor(Color.LightGray); linear.AddView(phoneMask); errotextPhone = new TextView(con); errotextPhone.SetTextColor(Color.Red); errotextPhone.TextSize = 12; errotextPhone.Typeface = Typeface.Default; linear.AddView(errotextPhone); TextView transferButtonSpacing = new TextView(con); transferButtonSpacing.SetHeight(30); Button transferButton = new Button(con); transferButton.SetWidth(ActionBar.LayoutParams.MatchParent); transferButton.SetHeight(40); transferButton.Text = "TRANSFER MONEY"; transferButton.SetTextColor(Color.White); transferButton.SetBackgroundColor(Color.Rgb(72, 178, 224)); transferButton.Click += (object sender, EventArgs e) => { if (string.IsNullOrEmpty(sfToAccount.Text) || string.IsNullOrEmpty(sfDesc.Text) || string.IsNullOrEmpty(amountMask.Text) || string.IsNullOrEmpty(emailMask.Text) || string.IsNullOrEmpty(phoneMask.Text)) { resultsDialog.SetMessage("Please fill all the required data!"); } else if ((sfToAccount.HasError || sfDesc.HasError || amountMask.HasError || emailMask.HasError || phoneMask.HasError)) { resultsDialog.SetMessage("Please enter valid details"); } else { resultsDialog.SetMessage(string.Format("Amount of {0} has been transferred successfully!", amountMask.Value)); string mask1 = sfToAccount.Mask; sfToAccount.Mask = string.Empty; sfToAccount.Mask = mask1; mask1 = sfDesc.Mask; sfDesc.Mask = "0"; sfDesc.Mask = mask1; mask1 = amountMask.Mask; amountMask.Mask = string.Empty; amountMask.Mask = mask1; mask1 = emailMask.Mask; emailMask.Mask = string.Empty; emailMask.Mask = mask1; mask1 = phoneMask.Mask; phoneMask.Mask = string.Empty; phoneMask.Mask = mask1; } resultsDialog.Create().Show(); }; linear.AddView(transferButtonSpacing); linear.AddView(transferButton); TextView transferAfterButtonSpacing = new TextView(con); transferAfterButtonSpacing.SetHeight(60); linear.AddView(transferAfterButtonSpacing); sfToAccount.ValueChanged += SfToAccount_ValueChanged; sfToAccount.MaskInputRejected += SfToAccount_MaskInputRejected; amountMask.ValueChanged += AmountMask_ValueChanged; amountMask.MaskInputRejected += AmountMask_MaskInputRejected; emailMask.ValueChanged += EmailMask_ValueChanged; emailMask.MaskInputRejected += EmailMask_MaskInputRejected; phoneMask.ValueChanged += PhoneMask_ValueChanged; phoneMask.MaskInputRejected += PhoneMask_MaskInputRejected; linear.Touch += (object sender, View.TouchEventArgs e) => { if (sfToAccount.IsFocused || sfDesc.IsFocused || amountMask.IsFocused || emailMask.IsFocused || phoneMask.IsFocused) { Rect outRect = new Rect(); sfToAccount.GetGlobalVisibleRect(outRect); sfDesc.GetGlobalVisibleRect(outRect); amountMask.GetGlobalVisibleRect(outRect); emailMask.GetGlobalVisibleRect(outRect); phoneMask.GetGlobalVisibleRect(outRect); if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) { sfToAccount.ClearFocus(); sfDesc.ClearFocus(); amountMask.ClearFocus(); emailMask.ClearFocus(); phoneMask.ClearFocus(); } } hideSoftKeyboard((Activity)con); }; //results dialog resultsDialog = new AlertDialog.Builder(con); resultsDialog.SetTitle("Status"); resultsDialog.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) => { }); resultsDialog.SetCancelable(true); frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor(Color.White); frame.SetPadding(10, 10, 10, 10); //scrollView1 mainPageScrollView = new ScrollView(con); mainPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.7), GravityFlags.Top | GravityFlags.CenterHorizontal); mainPageScrollView.AddView(linear); frame.AddView(mainPageScrollView); //buttomButtonLayout buttomButtonLayout = new FrameLayout(con); buttomButtonLayout.SetBackgroundColor(Color.Transparent); buttomButtonLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.1), GravityFlags.Bottom | GravityFlags.CenterHorizontal); //propertyButton propertyButton = new Button(con); propertyButton.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Bottom | GravityFlags.CenterHorizontal); propertyButton.Text = "OPTIONS"; propertyButton.Gravity = GravityFlags.Start; propertyFrameLayout = new FrameLayout(con); propertyFrameLayout.SetBackgroundColor(Color.Rgb(236, 236, 236)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); //propertyButton Click Listener propertyButton.Click += (object sender, EventArgs e) => { buttomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); propPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.Bottom | GravityFlags.CenterHorizontal); mainPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.7), GravityFlags.Top | GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); }; //scrollView propPageScrollView = new ScrollView(con); propPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.Bottom | GravityFlags.CenterHorizontal); propPageScrollView.AddView(propertyFrameLayout); frame.AddView(propPageScrollView); frame.AddView(buttomButtonLayout); frame.FocusableInTouchMode = true; return(frame); }
public MaskedEdit_Tablet() { view = new UIView(); this.OptionView = new UIView(); this.cultureList = new List <string>() { (NSString)"United States", (NSString)"United Kingdom", (NSString)"Japan", (NSString)"France", (NSString)"Italy" }; this.inputValidationModeList = new List <string>() { (NSString)"Key Press", (NSString)"Lost Focus" }; this.promptCharList = new List <string>() { "_", "*", "~" }; fundTransferLable = new UILabel(); fundTransferLable.TextColor = UIColor.Black; fundTransferLable.BackgroundColor = UIColor.Clear; fundTransferLable.Text = @"Funds Transfer"; fundTransferLable.TextAlignment = UITextAlignment.Left; fundTransferLable.Font = UIFont.FromName("Helvetica-Bold", 20f); controlView.AddSubview(fundTransferLable); accountLabel = new UILabel(); accountLabel.Text = "To Account"; accountLabel.TextColor = UIColor.Black; accountLabel.Font = UIFont.FromName("Helvetica", 16f); controlView.AddSubview(accountLabel); acccountmaskedEdit = new SfMaskedEdit(); acccountmaskedEdit.Mask = "0000 0000 0000 0000"; acccountmaskedEdit.Culture = new CultureInfo("en-us"); acccountmaskedEdit.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; acccountmaskedEdit.ClipsToBounds = true; acccountmaskedEdit.Layer.BorderColor = UIColor.LightGray.CGColor; acccountmaskedEdit.HidePromptOnLeave = true; acccountmaskedEdit.ValidationMode = InputValidationMode.KeyPress; acccountmaskedEdit.MaskInputRejected += AcccountmaskedEdit_MaskInputRejected; acccountmaskedEdit.ValueChanged += AcccountmaskedEdit_ValueChanged1; acccountmaskedEdit.TextAlignment = UITextAlignment.Left; acccountmaskedEdit.Placeholder = "1234 1234 1234 1234"; controlView.AddSubview(acccountmaskedEdit); accInputRejectLable = new UILabel(); accInputRejectLable.Font = UIFont.FromName("Helvetica", 14f); accInputRejectLable.TextColor = UIColor.Red; accInputRejectLable.Hidden = true; controlView.AddSubview(accInputRejectLable); descriptionLabel = new UILabel(); descriptionLabel.Text = "Description"; descriptionLabel.TextColor = UIColor.Black; descriptionLabel.Font = UIFont.FromName("Helvetica", 16f); controlView.AddSubview(descriptionLabel); descriptionmaskedEdit = new SfMaskedEdit(); descriptionmaskedEdit.Mask = ""; descriptionmaskedEdit.Culture = new CultureInfo("en-us"); descriptionmaskedEdit.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; descriptionmaskedEdit.Placeholder = "Enter description"; descriptionmaskedEdit.TextAlignment = UITextAlignment.Left; descriptionmaskedEdit.ClipsToBounds = true; descriptionmaskedEdit.Layer.BorderColor = UIColor.LightGray.CGColor; controlView.AddSubview(descriptionmaskedEdit); amountLabel = new UILabel(); amountLabel.Text = "Amount"; amountLabel.TextColor = UIColor.Black; amountLabel.Font = UIFont.FromName("Helvetica", 16f); controlView.AddSubview(amountLabel); amountmaskedEdit = new SfMaskedEdit(); amountmaskedEdit.Mask = "$ 0,000.00"; amountmaskedEdit.Culture = new CultureInfo("en-us"); amountmaskedEdit.ValueMaskFormat = MaskFormat.IncludeLiterals; amountmaskedEdit.Placeholder = "$ 3,874.00"; amountmaskedEdit.ValidationMode = InputValidationMode.KeyPress; amountmaskedEdit.MaskInputRejected += AmountmaskedEdit_MaskInputRejected; amountmaskedEdit.ValueChanged += AmountmaskedEdit_ValueChanged1; amountmaskedEdit.Layer.BorderColor = UIColor.LightGray.CGColor; amountmaskedEdit.TextAlignment = UITextAlignment.Left; controlView.AddSubview(amountmaskedEdit); amtInputRejectLable = new UILabel(); amtInputRejectLable.Font = UIFont.FromName("Helvetica", 14f); amtInputRejectLable.TextColor = UIColor.Red; amtInputRejectLable.Hidden = true; controlView.AddSubview(amtInputRejectLable); emailIDLabel = new UILabel(); emailIDLabel.Text = "Email ID"; emailIDLabel.TextColor = UIColor.Black; emailIDLabel.Font = UIFont.FromName("Helvetica", 16f); controlView.AddSubview(emailIDLabel); emailIDmaskedEdit = new SfMaskedEdit(); emailIDmaskedEdit.Mask = @"\w+@\w+\.\w+"; emailIDmaskedEdit.Culture = new CultureInfo("en-us"); emailIDmaskedEdit.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; emailIDmaskedEdit.Placeholder = "*****@*****.**"; emailIDmaskedEdit.ValidationMode = InputValidationMode.KeyPress; emailIDmaskedEdit.MaskInputRejected += EmailIDmaskedEdit_MaskInputRejected; emailIDmaskedEdit.ValueChanged += EmailIDmaskedEdit_ValueChanged1; emailIDmaskedEdit.MaskType = MaskType.RegEx; emailIDmaskedEdit.Layer.BorderColor = UIColor.LightGray.CGColor; controlView.AddSubview(emailIDmaskedEdit); emailInputRejectLable = new UILabel(); emailInputRejectLable.Font = UIFont.FromName("Helvetica", 14f); emailInputRejectLable.TextColor = UIColor.Red; emailInputRejectLable.Hidden = true; controlView.AddSubview(emailInputRejectLable); mobileNumberLabel = new UILabel(); mobileNumberLabel.Text = "Mobile Number"; mobileNumberLabel.TextColor = UIColor.Black; mobileNumberLabel.Font = UIFont.FromName("Helvetica", 16f); controlView.AddSubview(mobileNumberLabel); mobileNumbermaskedEdit = new SfMaskedEdit(); mobileNumbermaskedEdit.Mask = "+1 000 000 0000"; mobileNumbermaskedEdit.Culture = new CultureInfo("en-us"); mobileNumbermaskedEdit.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; mobileNumbermaskedEdit.ClipsToBounds = true; mobileNumbermaskedEdit.Layer.BorderColor = UIColor.LightGray.CGColor; mobileNumbermaskedEdit.ValidationMode = InputValidationMode.KeyPress; mobileNumbermaskedEdit.MaskInputRejected += MobileNumbermaskedEdit_MaskInputRejected; mobileNumbermaskedEdit.ValueChanged += MobileNumbermaskedEdit_ValueChanged1; mobileNumbermaskedEdit.Placeholder = "+1 323 339 3392"; mobileNumbermaskedEdit.TextAlignment = UITextAlignment.Left; controlView.AddSubview(mobileNumbermaskedEdit); phoneInputRejectLable = new UILabel(); phoneInputRejectLable.Font = UIFont.FromName("Helvetica", 14f); phoneInputRejectLable.TextColor = UIColor.Red; phoneInputRejectLable.Hidden = true; controlView.AddSubview(phoneInputRejectLable); //searchButtonn searchButton.SetTitle("Transfer Money", UIControlState.Normal); searchButton.SetTitleColor(UIColor.White, UIControlState.Normal); searchButton.BackgroundColor = UIColor.FromRGB(50, 150, 221); searchButton.SetTitleColor(UIColor.Black, UIControlState.Normal); searchButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; searchButton.Layer.CornerRadius = 8; searchButton.Layer.BorderWidth = 2; searchButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor; searchButton.TouchUpInside += FoundTransfer; controlView.AddSubview(searchButton); this.AddSubview(controlView); mainPageDesign(); optionView(); }
public override View GetSampleContent(Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text2 = new TextView(con); text2.TextSize = 17; text2.TextAlignment = TextAlignment.Center; text2.Text = "This sample demonstrates the performance of Syncfusion XlsIO library to create larger Excel files."; text2.SetTextColor(Color.ParseColor("#262626")); text2.SetPadding(5, 5, 5, 5); linear.AddView(text2); TextView space = new TextView(con); space.TextSize = 10; linear.AddView(space); TextView text3 = new TextView(con); text3.TextSize = 15; text3.Text = "Enter the no. of rows"; text3.SetTextColor(Color.ParseColor("#262626")); linear.AddView(text3); textBox1 = new SfMaskedEdit(con); textBox1.Value = 5000; linear.AddView(textBox1); TextView space3 = new TextView(con); space3.TextSize = 10; linear.AddView(space3); TextView text4 = new TextView(con); text4.TextSize = 15; text4.TextAlignment = TextAlignment.Center; text4.Text = "Enter the no. of columns"; linear.AddView(text4); textBox2 = new SfMaskedEdit(con); textBox2.Value = 50; linear.AddView(textBox2); TextView space1 = new TextView(con); space1.TextSize = 10; linear.AddView(space1); chkImport = new CheckBox(con); chkImport.Text = "Import on Save"; linear.AddView(chkImport); TextView text = new TextView(con); text.TextSize = 13; text.Text = "Import on Save option directly serialize data while saving the workbook."; linear.AddView(text); TextView space2 = new TextView(con); space1.TextSize = 10; linear.AddView(space2); m_context = con; Button button1 = new Button(con); button1.Text = "Generate Excel"; button1.Click += Button1_Click; linear.AddView(button1); return(linear); }
public View GetSampleContent(Context con) { ScrollView scroll = new ScrollView(con); bool isTablet = SfMaskedEditText.IsTabletDevice(con); LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(12, 12, 12, 12); TextView headLabel = new TextView(con); headLabel.TextSize = 30; headLabel.SetTextColor(Color.ParseColor("#262626")); headLabel.Typeface = Typeface.DefaultBold; headLabel.Text = "Funds Transfer"; linear.AddView(headLabel); TextView fundTransferLabelSpacing = new TextView(con); fundTransferLabelSpacing.SetHeight(40); linear.AddView(fundTransferLabelSpacing); TextView textToAccount = new TextView(con); textToAccount.SetTextColor(Color.ParseColor("#6d6d72")); textToAccount.TextSize = 16; textToAccount.Typeface = Typeface.Default; textToAccount.Text = "To Account"; textToAccount.SetPadding(0, 0, 0, 10); linear.AddView(textToAccount); sfToAccount = new SfMaskedEdit(con); sfToAccount.Mask = "0000 0000 0000 0000"; sfToAccount.Gravity = GravityFlags.Start; sfToAccount.ValidationMode = InputValidationMode.KeyPress; sfToAccount.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfToAccount.Hint = "1234 1234 1234 1234"; sfToAccount.SetHintTextColor(Color.LightGray); sfToAccount.ClearButtonVisibility = ClearButtonVisibilityMode.WhileEditing; linear.AddView(sfToAccount); erroToAccount = new TextView(con); erroToAccount.SetTextColor(Color.Red); erroToAccount.TextSize = 12; erroToAccount.Typeface = Typeface.Default; linear.AddView(erroToAccount); TextView textDesc = new TextView(con); textDesc.Text = "Description"; textDesc.Typeface = Typeface.Default; textDesc.SetPadding(0, 30, 0, 10); textDesc.TextSize = 16; linear.AddView(textDesc); sfDesc = new SfMaskedEdit(con); sfDesc.Mask = ""; sfDesc.Gravity = GravityFlags.Start; sfDesc.ValidationMode = InputValidationMode.KeyPress; sfDesc.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfDesc.Hint = "Enter description"; sfDesc.SetHintTextColor(Color.LightGray); sfDesc.ClearButtonVisibility = ClearButtonVisibilityMode.WhileEditing; linear.AddView(sfDesc); TextView textAmount = new TextView(con); textAmount.Text = "Amount"; textAmount.Typeface = Typeface.Default; textAmount.SetPadding(0, 30, 0, 10); textAmount.TextSize = 16; linear.AddView(textAmount); amountMask = new SfMaskedEdit(con); amountMask.Mask = "$ 0,000.00"; amountMask.Gravity = GravityFlags.Start; amountMask.ValidationMode = InputValidationMode.KeyPress; amountMask.ValueMaskFormat = MaskFormat.IncludePromptAndLiterals; amountMask.Hint = "$ 3,874.00"; amountMask.SetHintTextColor(Color.LightGray); amountMask.ClearButtonVisibility = ClearButtonVisibilityMode.WhileEditing; linear.AddView(amountMask); errotextAmount = new TextView(con); errotextAmount.SetTextColor(Color.Red); errotextAmount.TextSize = 12; errotextAmount.Typeface = Typeface.Default; linear.AddView(errotextAmount); TextView textEmail = new TextView(con); textEmail.Text = "Email ID"; textEmail.Typeface = Typeface.Default; textEmail.SetPadding(0, 30, 0, 10); textEmail.TextSize = 16; linear.AddView(textEmail); emailMask = new SfMaskedEdit(con); emailMask.Mask = @"\w+@\w+\.\w+"; emailMask.MaskType = MaskType.RegEx; emailMask.Gravity = GravityFlags.Start; emailMask.ValidationMode = InputValidationMode.KeyPress; emailMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; emailMask.Hint = "*****@*****.**"; emailMask.SetHintTextColor(Color.LightGray); emailMask.ClearButtonVisibility = ClearButtonVisibilityMode.WhileEditing; linear.AddView(emailMask); errotextEmail = new TextView(con); errotextEmail.SetTextColor(Color.Red); errotextEmail.TextSize = 12; errotextEmail.Typeface = Typeface.Default; linear.AddView(errotextEmail); TextView textPhone = new TextView(con); textPhone.Text = "Mobile Number "; textPhone.Typeface = Typeface.Default; textPhone.SetPadding(0, 30, 0, 10); textPhone.TextSize = 16; linear.AddView(textPhone); phoneMask = new SfMaskedEdit(con); phoneMask.Mask = "+1 000 000 0000"; phoneMask.Gravity = GravityFlags.Start; phoneMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; phoneMask.ValidationMode = InputValidationMode.KeyPress; phoneMask.Hint = "+1 323 339 3392"; phoneMask.SetHintTextColor(Color.LightGray); phoneMask.ClearButtonVisibility = ClearButtonVisibilityMode.WhileEditing; linear.AddView(phoneMask); errotextPhone = new TextView(con); errotextPhone.SetTextColor(Color.Red); errotextPhone.TextSize = 12; errotextPhone.Typeface = Typeface.Default; linear.AddView(errotextPhone); TextView searchButtonSpacing = new TextView(con); searchButtonSpacing.SetHeight(30); Button searchButton = new Button(con); searchButton.SetWidth(ActionBar.LayoutParams.MatchParent); searchButton.SetHeight(40); searchButton.Text = "TRANSFER MONEY"; searchButton.SetTextColor(Color.White); searchButton.SetBackgroundColor(Color.Gray); searchButton.Click += (object sender, EventArgs e) => { if (string.IsNullOrEmpty(sfToAccount.Text) || string.IsNullOrEmpty(sfDesc.Text) || string.IsNullOrEmpty(amountMask.Text) || string.IsNullOrEmpty(emailMask.Text) || string.IsNullOrEmpty(phoneMask.Text)) { resultsDialog.SetMessage("Please fill all the required data!"); } else if ((sfToAccount.HasError || sfDesc.HasError || amountMask.HasError || emailMask.HasError || phoneMask.HasError)) { resultsDialog.SetMessage("Please enter valid details"); } else { resultsDialog.SetMessage(string.Format("Amount of {0} has been transferred successfully!", amountMask.Value)); string mask1 = sfToAccount.Mask; sfToAccount.Mask = string.Empty; sfToAccount.Mask = mask1; mask1 = sfDesc.Mask; sfDesc.Mask = "0"; sfDesc.Mask = mask1; mask1 = amountMask.Mask; amountMask.Mask = string.Empty; amountMask.Mask = mask1; mask1 = emailMask.Mask; emailMask.Mask = string.Empty; emailMask.Mask = mask1; mask1 = phoneMask.Mask; phoneMask.Mask = string.Empty; phoneMask.Mask = mask1; } resultsDialog.Create().Show(); }; linear.AddView(searchButtonSpacing); linear.AddView(searchButton); sfToAccount.ValueChanged += SfToAccount_ValueChanged; sfToAccount.MaskInputRejected += SfToAccount_MaskInputRejected; amountMask.ValueChanged += AmountMask_ValueChanged; amountMask.MaskInputRejected += AmountMask_MaskInputRejected; emailMask.ValueChanged += EmailMask_ValueChanged; emailMask.MaskInputRejected += EmailMask_MaskInputRejected; phoneMask.ValueChanged += PhoneMask_ValueChanged; phoneMask.MaskInputRejected += PhoneMask_MaskInputRejected; //results dialog resultsDialog = new AlertDialog.Builder(con); resultsDialog.SetTitle("Status"); resultsDialog.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) => { }); resultsDialog.SetCancelable(true); scroll.AddView(linear); return(scroll); }