Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _helper.Clean();
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Button> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                return;
            }

            if (e?.OldElement != null)
            {
                _helper.Clean();
            }

            if (e?.NewElement == null)
            {
                return;
            }

            _materialButton = Element as MaterialButton;
            _helper         = new MaterialDrawableHelper(_materialButton, Control);
            _helper.UpdateDrawable();

            Control.SetMinimumWidth((int)MaterialHelper.ConvertToDp(64));
            Control.SetAllCaps(_materialButton != null && _materialButton.AllCaps);

            SetButtonIcon();
            SetTextColors();
            SetTextLetterSpacing();
        }
Ejemplo n.º 3
0
        protected override void OnElementChanged(ElementChangedEventArgs <Button> e)
        {
            base.OnElementChanged(e);

            if (e?.OldElement != null)
            {
                _helper.Clean();
            }

            if (e?.NewElement != null)
            {
                _materialButton = this.Element as MaterialButton;
                _helper         = new MaterialDrawableHelper(_materialButton, this.Control);
                _helper.UpdateDrawable();

                this.Control.SetMinimumWidth((int)MaterialHelper.ConvertToDp(64));
                this.Control.SetAllCaps(_materialButton.AllCaps);

                this.SetButtonIcon();
                this.SetTextColors();
            }
        }