private void BeeLanded(object sender, object e) { BeeControl landedBee = null; foreach (BeeControl sprite in _beeControls) { if (sprite.FallingStoryboard == sender) { landedBee = sprite; } } _model.BeeLanded(Canvas.GetLeft(landedBee)); if (landedBee != null) { _beeControls.Remove(landedBee); } }
void HiveTimerTick(object sender, object e) { if (_playAreaSize.Width <= 0) { return; } double x = _model.NextHiveLocation(); HiveMargin = new Thickness(x, 0, 0, 0); OnPropertyChanged("HiveMargin"); BeeControl bee = new BeeControl(x + _hiveSize.Width / 2, 0, _playAreaSize.Height + _flowerSize.Height / 3, BeeLanded); bee.Width = _beeSize.Width; bee.Height = _beeSize.Height; _beeControls.Add(bee); }
void HiveTimerTick(object sender, EventArgs e) { if (_playAreaSize.Width <= 0) return; double x = _model.NextHiveLocation(); HiveMargin = new Thickness(x, 0, 0, 0); OnPropertyChanged("HiveMargin"); BeeControl bee = new BeeControl(x + _hiveSize.Width / 2, 0, _playAreaSize.Height + _flowerSize.Height / 3, BeeLanded); bee.Width = _beeSize.Width; bee.Height = _beeSize.Height; _beeControls.Add(bee); }