private void ModelShotMovedEventHandler(object sender, ShotMovedEventArgs e) { if (!e.IsDisappeared) { if (!_shots.ContainsKey(e.Shot)) { FrameworkElement shotControl = InvadersHelper.ShotControlFactory(e.Shot, Scale); _shots[e.Shot] = shotControl; _sprites.Add(shotControl); } else { FrameworkElement shotControl = _shots[e.Shot]; InvadersHelper.MoveElementOnCanvas(shotControl, e.Shot.Location.X * Scale, e.Shot.Location.Y * Scale); } } else { if (_shots.ContainsKey(e.Shot)) { FrameworkElement shotControl = _shots[e.Shot]; _sprites.Remove(shotControl); _shots.Remove(e.Shot); } } }