public ButtonBase(IUIStyle style) : base(style) { buttonStyle = StyleSystem.StylesFor <ButtonStyleDefinition>(); actionPerformedSupport = new EventSupport <EventArgs>(); selectionChangedSupport = new EventSupport <EventArgs>(); pressedAnimation = new SmoothValue(1f, 0f, 0.1f); pressedAnimation.FinishAnimation(); Focusable = true; FocusedChanged += (sender, args) => ResetPressState(); MouseDown += OnMouseDown; MouseUp += OnMouseUp; MouseClicked += OnMouseClick; KeyPressed += OnKeyPressed; KeyReleased += OnKeyReleased; }
protected internal void ResetPressState() { pressedAnimation.FinishAnimation(); IsPressed = false; }