//protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) //{ // base.OnElementPropertyChanged(sender, e); // if (Element == null) // return; // var entryEx = Element as Entry; // if (e.PropertyName == EntryEx.BorderWidthProperty.PropertyName || // e.PropertyName == EntryEx.BorderColorProperty.PropertyName || // e.PropertyName == EntryEx.BorderRadiusProperty.PropertyName || // e.PropertyName == EntryEx.BackgroundColorProperty.PropertyName) // { // UpdateBackground(entryEx); // } // else if (e.PropertyName == EntryEx.LeftPaddingProperty.PropertyName || // e.PropertyName == EntryEx.RightPaddingProperty.PropertyName) // { // UpdatePadding(entryEx); // } // else if (e.PropertyName == Entry.HorizontalTextAlignmentProperty.PropertyName) // { // UpdateTextAlighnment(entryEx); // } //} protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (_renderer != null) { _renderer.Dispose(); _renderer = null; } } }
private void UpdateBackground(Entry entryEx) { if (_renderer != null) { _renderer.Dispose(); _renderer = null; } _renderer = new BorderRenderer(); Control.Background = _renderer.GetBorderBackground(Color.FromHex("#5C5C5C"), Color.FromHex("#e4e4e4"), 1, 30); Control.SetTextColor(Android.Graphics.Color.ParseColor("#5C5C5C")); }