private void OnMouseDown(object sender, InputEventArgs e) { Vector2 physicalPosition = new Vector2(e.X, e.Y) / Constants.PixelsPerMeter; if (this.tank.FireMissileCommand.CanExecute(physicalPosition)) { this.tank.FireMissileCommand.Execute(physicalPosition); } }
private void OnMouseMoved(object sender, InputEventArgs e) { Vector2 physicalPosition = new Vector2(e.X, e.Y) / Constants.PixelsPerMeter; this.tank.PointTurretCommand.Execute(physicalPosition); }
private void OnMouseDown(object sender, InputEventArgs e) { if (this.IsVisible && this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y)) { //this.scaleTween.Restart(); this.scaleTween.IsPaused = false; this.inputManager.DragEnded += this.OnDragEnded; } }
private void OnClick(object sender, InputEventArgs e) { this.viewModel.GoToTitle(); }
private void OnDragEnded(object sender, InputEventArgs e) { if (!this.IsVisible) { return; } //this.scaleTween.Reverse(); this.scaleTween.IsPaused = false; this.inputManager.DragEnded -= this.OnDragEnded; if (this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y)) { this.Execute(); } }