Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. StoryBoard is not working

StoryBoard is not working

Scheduled Pinned Locked Moved WCF and WF
help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AghaKhan
    wrote on last edited by
    #1

    If I add scale.BeginAnimation(ScaleTransform.ScaleXProperty, growAnimation); then animation works fine, but I need to add timeline, so StortBoard should work. Now I added almost same code Now it is not working. Am I am setting the wrong Property, but I shouldn't because it is same property. Storyboard.SetTarget(growAnimation, myCanvas); Storyboard.SetTargetProperty(growAnimation, new PropertyPath(ScaleTransform.ScaleXProperty)); sb.Children.Add(growAnimation); sb.Begin(); Any help will be very much appriciated. Agha Khan private void Animate() { Image finalImage = new Image(); BitmapImage logo = new BitmapImage(); logo.BeginInit(); logo.UriSource = new Uri("pack://application:,,,/Billboard;component/Images/Crystal.jpg"); logo.EndInit(); finalImage.Source = logo; Canvas myCanvas = new Canvas(); myCanvas.Width = 660; myCanvas.Height = 475; myCanvas.Background = new ImageBrush(finalImage.Source); this.ImageGrid.Children.Add(myCanvas); Storyboard sb = new Storyboard(); ScaleTransform scale = new ScaleTransform(1.0, 1.0, 33, 0); myCanvas.RenderTransformOrigin = new Point(0, 0); myCanvas.RenderTransform = scale; DoubleAnimation growAnimation = new DoubleAnimation(1, 0, TimeSpan.FromSeconds(2)); growAnimation.BeginTime = TimeSpan.FromSeconds(0); // Apply the animation to the Canvas's Width property. // myCanvas.BeginAnimation(Canvas.WidthProperty, growAnimation); // scale.BeginAnimation(ScaleTransform.ScaleXProperty, growAnimation); Storyboard.SetTarget(growAnimation, myCanvas); Storyboard.SetTargetProperty(growAnimation, new PropertyPath(ScaleTransform.ScaleXProperty)); // Looks like bug is in above line, but unable to find it. sb.Children.Add(growAnimation); sb.Begin(); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups