protected override void OnDetached()
 {
     Container.RemoveConstraints(_constraint);
     _textLabel.RemoveFromSuperview();
     _textLabel.Dispose();
     _constraint = null;
     _textLabel  = null;
 }
        protected override void OnDetached()
        {
            Container.RemoveConstraints(_constraint);
            _textLabel.RemoveFromSuperview();
            _textLabel.Dispose();
            _constraint = null;
            _textLabel  = null;

            System.Diagnostics.Debug.WriteLine($"Detached {GetType().Name} from {Element.GetType().FullName}");
        }
        protected override void OnAttached()
        {
            _textLabel = new PaddingLabel();
            _textLabel.LineBreakMode                  = UILineBreakMode.Clip;
            _textLabel.Lines                          = 1;
            _textLabel.TintAdjustmentMode             = UIViewTintAdjustmentMode.Automatic;
            _textLabel.AdjustsFontSizeToFitWidth      = true;
            _textLabel.BaselineAdjustment             = UIBaselineAdjustment.AlignCenters;
            _textLabel.AdjustsLetterSpacingToFitWidth = true;

            Container.AddSubview(_textLabel);

            _textLabel.TranslatesAutoresizingMaskIntoConstraints = false;

            UpdateText();
            UpdateFontSize();
            UpdateTextColor();
            UpdateBackgroundColor();
            UpdatePadding();
            UpdateConstraint();
        }