Example #1
0
        private void OnMouseDown(object sender, InputEventArgs e)
        {
            if (this.IsVisible && this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y))
            {
                if (this.scaleTween.IsReversed)
                {
                    this.scaleTween.Reverse();
                }

                this.scaleTween.Restart();
                this.inputManager.DragEnded += this.OnDragEnded;
            }
        }
Example #2
0
        private void OnDragEnded(object sender, InputEventArgs e)
        {
            if (!this.IsVisible)
            {
                return;
            }

            this.scaleTween.Reverse();
            this.scaleTween.Restart();
            this.inputManager.DragEnded -= this.OnDragEnded;
            if (this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y))
            {
                this.soundManager.PlaySound("Click");
                this.Execute();
            }
        }