예제 #1
0
        protected override void Dispose(bool disposing)
        {
            if (Control is MaterialStepper control)
            {
                control.DecrementButton.TouchUpInside -= OnStep;
                control.IncrementButton.TouchUpInside -= OnStep;
            }

            _buttonScheme?.Dispose();
            _buttonScheme = null;

            base.Dispose(disposing);
        }
예제 #2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Button> e)
        {
            // recreate the scheme
            _buttonScheme?.Dispose();
            _buttonScheme = CreateButtonScheme();

            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    _defaultButtonScheme = CreateButtonScheme();

                    SetNativeControl(CreateNativeControl());

                    Control.TouchUpInside += OnButtonTouchUpInside;
                    Control.TouchDown     += OnButtonTouchDown;
                }

                UpdateFont();
                UpdateCornerRadius();
                UpdateBorder();
                UpdateTextColor();
                _buttonLayoutManager?.Update();
                ApplyTheme();
            }
        }
예제 #3
0
        public void Dispose()
        {
            ButtonScheme.OnButtonPress     -= ButtonScheme_OnButtonPress;
            ButtonRace.OnButtonPress       -= ButtonRace_OnButtonPress;
            ButtonPlayerType.OnButtonPress -= ButtonPlayerType_OnButtonPress;

            BackRect.Dispose();
            TextUser.Dispose();
            ButtonPlayerType.Dispose();
            TextPlayerType.Dispose();
            ButtonRace.Dispose();
            TextRace.Dispose();
            ButtonScheme.Dispose();
            TextScheme.Dispose();
        }