This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <resources> | |
| <style name="MyTheme" parent="MyTheme.Base"> | |
| </style> | |
| <style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> | |
| <item name="windowNoTitle">true</item> | |
| <item name="colorPrimary">#2196F3</item> | |
| <item name="colorPrimaryDark">#1976D2</item> | |
| <item name="colorAccent">#FF4081</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExtendedEntry : Entry | |
| { | |
| public static readonly BindableProperty IsBorderErrorVisibleProperty = | |
| BindableProperty.Create(nameof(IsBorderErrorVisible), typeof(bool), typeof(ExtendedEntry), false, BindingMode.TwoWay); | |
| public bool IsBorderErrorVisible | |
| { | |
| get { return (bool)GetValue(IsBorderErrorVisibleProperty); } | |
| set | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [assembly: ExportRenderer(typeof(ExtendedEntry), typeof(ExtendedEntryRenderer))] | |
| namespace EntryValidationBorder.iOS | |
| { | |
| public class ExtendedEntryRenderer : EntryRenderer | |
| { | |
| protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) | |
| { | |
| base.OnElementPropertyChanged(sender, e); | |
| if (Control == null || this.Element == null) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [assembly: ExportRenderer(typeof(ExtendedEntry), typeof(ExtendedEntryRenderer))] | |
| namespace EntryValidationBorder.Droid.Renderers | |
| { | |
| public class ExtendedEntryRenderer : EntryRenderer | |
| { | |
| protected override void OnElementChanged(ElementChangedEventArgs<Entry> e) | |
| { | |
| base.OnElementChanged(e); | |
| if (Control == null || e.NewElement == null) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EmptyEntryValidatorBehavior : Behavior<ExtendedEntry> | |
| { | |
| ExtendedEntry control; | |
| string _placeHolder; | |
| Xamarin.Forms.Color _placeHolderColor; | |
| protected override void OnAttachedTo(ExtendedEntry bindable) | |
| { | |
| bindable.TextChanged += HandleTextChanged; | |
| bindable.PropertyChanged += OnPropertyChanged; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
| x:Class="EntryValidationBorder.MainPage" | |
| xmlns:local="clr-namespace:EntryValidationBorder" | |
| xmlns:behavior="clr-namespace:EntryValidationBorder.Behavior"> | |
| <ContentPage.Content> | |
| <StackLayout VerticalOptions="CenterAndExpand" Padding="20" x:Name="layout"> | |
| <local:ExtendedEntry Placeholder="Name" ErrorText="{Binding User.FirstName.NotValidMessageError}" | |
| BorderErrorColor="Red" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class User: INotifyPropertyChanged | |
| { | |
| public Field FirstName { get; set; } = new Field(); | |
| public Field Email { get; set; }= new Field(); | |
| public Field Password { get; set; }= new Field(); | |
| public event PropertyChangedEventHandler PropertyChanged; | |
| } | |
| public class Field: INotifyPropertyChanged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.ComponentModel; | |
| using System.Windows.Input; | |
| using EntryValidationBorder.Models; | |
| using Xamarin.Forms; | |
| namespace EntryValidationBorder.ViewModels | |
| { | |
| public class MainPageViewModel: INotifyPropertyChanged | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using Xamarin.Forms; | |
| namespace StepProgressBarSample | |
| { | |
| public class StepProgressBarControl : StackLayout | |
| { | |
| Button _lastStepSelected; | |
| public static readonly BindableProperty StepsProperty =BindableProperty.Create(nameof(Steps), typeof(int), typeof(StepProgressBarControl), 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
| x:Class="StepProgressBarSample.MainPage" | |
| xmlns:local="clr-namespace:StepProgressBarSample" > | |
| <ContentPage.Content> | |
| <StackLayout Padding="10,40" > | |
| <local:StepProgressBarControl StepColor="Blue" Steps="5" StepSelected="1" x:Name="stepBar"/> | |
| <Label BindingContext="{x:Reference stepBar}" |