public MFlatButton() { 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; AutoSize = true; Margin = new Padding(4, 6, 4, 6); Padding = new Padding(0); }
public MCheckBox() { 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); }