/// <summary> /// Creates the instance of one single PIN box UI /// </summary> /// <returns></returns> private BoxTemplate CreateBox() { BoxTemplate boxTemplate = new BoxTemplate(); boxTemplate.HeightRequest = BoxSize; boxTemplate.WidthRequest = BoxSize; boxTemplate.Box.BackgroundColor = BoxBackgroundColor; boxTemplate.CharLabel.FontSize = BoxSize / 2; boxTemplate.GestureRecognizers.Add(boxTapGestureRecognizer); boxTemplate.BoxFocusColor = BoxFocusColor; boxTemplate.SecureMode(IsPassword); boxTemplate.SetColor(Color); boxTemplate.SetRadius(BoxShape); return(boxTemplate); }
/// <summary> /// Creates the instance of one single PIN box UI /// </summary> /// <returns></returns> private BoxTemplate CreateBox(char?charValue = null) { BoxTemplate boxTemplate = new BoxTemplate(); boxTemplate.HeightRequest = BoxSize; boxTemplate.WidthRequest = BoxSize; boxTemplate.Box.BackgroundColor = BoxBackgroundColor; boxTemplate.CharLabel.FontSize = BoxSize / 2; boxTemplate.GestureRecognizers.Add(boxTapGestureRecognizer); boxTemplate.BoxFocusColor = BoxFocusColor; boxTemplate.FocusAnimationType = BoxFocusAnimation; boxTemplate.SecureMode(IsPassword); boxTemplate.SetColor(Color, BoxBorderColor); boxTemplate.SetRadius(BoxShape); if (charValue.HasValue) { boxTemplate.SetValueWithAnimation(charValue.Value); } return(boxTemplate); }