private void DisplayFinish(object sender, EventArgs e, BCA_BoosterCard img_card, int id) { if (File.Exists(System.IO.Path.Combine(FormExecution.path, "BattleCityAlpha", "pics", id.ToString() + ".jpg"))) { img_card.SetImageSource(FormExecution.AssetsManager.GetPics(new string[] { "BattleCityAlpha", "pics", id.ToString() + ".jpg" })); } Storyboard storyboard = new Storyboard(); ScaleTransform scale = new ScaleTransform(1.0, 1.0); img_card.RenderTransformOrigin = new Point(0.5, 0.5); img_card.RenderTransform = scale; DoubleAnimation growAnimationOpen = new DoubleAnimation(); growAnimationOpen.Duration = TimeSpan.FromMilliseconds(200); growAnimationOpen.From = 0.0; growAnimationOpen.To = 1.0; storyboard.Children.Add(growAnimationOpen); Storyboard.SetTargetProperty(growAnimationOpen, new PropertyPath("RenderTransform.ScaleX")); Storyboard.SetTarget(growAnimationOpen, img_card); storyboard.Begin(); }
private void TranslateCard(PlayerCard card) { BCA_BoosterCard bca_bc = new BCA_BoosterCard(card, !_admin.Client.PlayerManager.Collections.ContainsKey(card.Id)); bca_bc.Margin = new Thickness(3); _admin.Client.PlayerManager.AddCard(card.Id, card.Quantity); bca_bc.SetImageSource(FormExecution.AssetsManager.GetImage("Sleeves", "203")); wp_cards.Children.Add(bca_bc); Storyboard storyboard = new Storyboard(); TranslateTransform translation = new TranslateTransform(0.0, 0.0); bca_bc.RenderTransformOrigin = new Point(0.5, 0.5); bca_bc.RenderTransform = translation; DoubleAnimation translateXAnimation = new DoubleAnimation(); translateXAnimation.Duration = TimeSpan.FromMilliseconds(200); translateXAnimation.From = -500; translateXAnimation.To = 0; storyboard.Children.Add(translateXAnimation); Storyboard.SetTargetProperty(translateXAnimation, new PropertyPath("RenderTransform.X")); Storyboard.SetTarget(translateXAnimation, bca_bc); storyboard.Completed += (senderA, eA) => Storyboard_Completed(senderA, eA, bca_bc, card.Id); storyboard.Begin(); }