Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 protected internal void ResetPressState()
 {
     pressedAnimation.FinishAnimation();
     IsPressed = false;
 }