Created
October 26, 2017 22:13
-
-
Save Char0394/50b54b83e28f234d523f1cb1cb0a5ebe to your computer and use it in GitHub Desktop.
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; | |
| if (e.PropertyName == ExtendedEntry.IsBorderErrorVisibleProperty.PropertyName){ | |
| if (((ExtendedEntry)this.Element).IsBorderErrorVisible) | |
| { | |
| this.Control.Layer.BorderColor = ((ExtendedEntry)this.Element).BorderErrorColor.ToCGColor(); | |
| this.Control.Layer.BorderWidth = new nfloat(0.8); | |
| this.Control.Layer.CornerRadius = 5; | |
| } | |
| else | |
| { | |
| this.Control.Layer.BorderColor = UIColor.LightGray.CGColor; | |
| this.Control.Layer.CornerRadius = 5; | |
| this.Control.Layer.BorderWidth = new nfloat(0.8); | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment