public LunaAnimatedButton()
        {
            Primary = false;

            _animationManager = new AnimationManager(false)
            {
                Increment     = 0.03,
                AnimationType = AnimationType.EaseOut
            };
            _hoverAnimationManager = new AnimationManager
            {
                Increment     = 0.07,
                AnimationType = AnimationType.Linear
            };

            _hoverAnimationManager.OnAnimationProgress += sender => Invalidate();
            _animationManager.OnAnimationProgress      += sender => Invalidate();

            AutoSizeMode = AutoSizeMode.GrowAndShrink;
            Margin       = new Padding(4, 6, 4, 6);
            Padding      = new Padding(0);
            Refresh();
        }
Esempio n. 2
0
        public AdvancedCheckBox()
        {
            _animationManager = new AnimationManager
            {
                AnimationType = AnimationType.EaseInOut,
                Increment     = 0.05
            };
            _rippleAnimationManager = new AnimationManager(false)
            {
                AnimationType      = AnimationType.Linear,
                Increment          = 0.10,
                SecondaryIncrement = 0.08
            };
            _animationManager.OnAnimationProgress       += sender => Invalidate();
            _rippleAnimationManager.OnAnimationProgress += sender => Invalidate();

            CheckedChanged += (sender, args) =>
            {
                _animationManager.StartNewAnimation(Checked ? AnimationDirection.In : AnimationDirection.Out);
            };

            Ripple        = true;
            MouseLocation = new Point(-1, -1);
        }