public async Task AddRandomBee() { await Application.Current.MainWindow.Dispatcher.InvokeAsync(() => { var bee = new AnimatedImage(RandomInt, RandomInt); _beeNest.Children.Add(bee); AnimateBee(bee); bee.MoveImage(TimeSpan.FromMilliseconds(_random.Next(100, 10000)), _beeFlyHerePath); bee.PlaySummSummSumm(); }); }
public void AnimateBee(AnimatedImage bee) { bee.AnimateImage(ImageNames, TimeSpan.FromMilliseconds(RandomInt)); }