Example #1
0
        public PasswordFloatingLabelEntry()
        {
            this.InputValidator = InputValidatorDelegate;
            this.MustValidate   = true;
            this.IsPassword     = true;
            this.LabelText      = "Test your password";
            var validEntryStateProperties = new FloatingLabelEntryStateProperties {
                IconSource      = ImageSource.FromFile("ValidationIcons/ValidIcon.png"),
                BorderColor     = Color.Green,
                BorderThickness = 3,
                InfoMessage     = "Password safe",
            };

            var errorEntryStateProperties = new FloatingLabelEntryStateProperties {
                IconSource      = ImageSource.FromFile("ValidationIcons/ErrorIcon.png"),
                BorderColor     = Color.Red,
                BorderThickness = 3,
                InfoMessage     = "Password very weak.",
            };

            var warningEntryStateProperties = new FloatingLabelEntryStateProperties {
                IconSource      = ImageSource.FromFile("ValidationIcons/WarningIcon.png"),
                BorderColor     = Color.FromHex("FFA500"),
                BorderThickness = 3,
                InfoMessage     = "Password strength average.",
            };

            var normalEntryStateProperties = new FloatingLabelEntryStateProperties {
                BorderColor     = Color.FromHex("4b9be0"),
                BorderThickness = 3,
            };

            this.AddPropertiesForState(validEntryStateProperties, FloatingLabelEntryState.Valid);
            this.AddPropertiesForState(warningEntryStateProperties, FloatingLabelEntryState.Warning);
            this.AddPropertiesForState(errorEntryStateProperties, FloatingLabelEntryState.Error);
            this.AddPropertiesForState(normalEntryStateProperties, FloatingLabelEntryState.Neutral);

            this.State = FloatingLabelEntryState.Neutral;
        }
Example #2
0
        public FloatLabeledEntry()
        {
            // NOTE: provide initial values; Styles from App.xaml will override this if exist
            HeightRequest         = 46;
            FontSize              = 16;
            CornerRadius          = 0f;
            BorderColor           = Color.FromHex("#dedede");
            BorderThickness       = 0;
            BottomBorderThickness = 1;

            // turn on validation
            MustValidate   = true;
            InputValidator = InputValidatorDelegate;

            var errorEntryStateProperties = new FloatingLabelEntryStateProperties {
                BorderColor = Color.Red
            };
            var normalEntryStateProperties = new FloatingLabelEntryStateProperties {
                BorderColor = Color.FromHex("#dedede")
            };

            AddPropertiesForState(errorEntryStateProperties, FloatingLabelEntryState.Error);
            AddPropertiesForState(normalEntryStateProperties, FloatingLabelEntryState.Neutral);
        }