Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Input controls property: IsRequired

$
0
0

Any chance of getting another property added to input controls? It would be useful to include an IsRequired property on entry and picker controls to reduce some validation logic. Created a custom bindable property per below:

        public class EntryCustomBinding : Entry
        {
            public static readonly BindableProperty IsRequiredProperty = BindableProperty.Create(
                nameof(IsRequired),
                typeof(bool),
                typeof(EntryCustomBinding),
                false);

            public bool IsRequired
            {
                get
                {
                    return IsRequired = (bool)GetValue(IsRequiredProperty);
                }
                set { SetValue(IsRequiredProperty, value); }
            }
        }

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>