RequiredStringValidationBehavior stays always invalid

85 Views Asked by At

Here is the code in question:

            StackLayout myLayout = new StackLayout
            { 
                Children =
                {
                    new Entry(),

                    new Entry(),
                    
                    new Entry()
                }
            };

            myLayout.Children.OfType<Entry>().ElementAt(2).Behaviors.Add
            (
                new RequiredStringValidationBehavior
                {
                    RequiredString = myLayout.Children.OfType<Entry>().ElementAt(1).Text,
                    InvalidStyle = invalidEntryStyle,
                    Flags = ValidationFlags.ValidateOnValueChanging
                }
            );

I type the exact same text in the third entry as the text in the second one, yet the validator says that the input is invalid.

What's wrong with the code?

0

There are 0 best solutions below