Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9013087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:10:06+00:00 2026-06-16T03:10:06+00:00

I am building Windows Store Application (Winrt, Metro, Windows 8 app). I try give

  • 0

I am building Windows Store Application (Winrt, Metro, Windows 8 app). I try give images in gridview animation: after image is loaded from web and opened it populates its cell.

I have storyboard for that:

            <Storyboard x:Name="PopupImageStoryboard">
                <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image">
                    <EasingDoubleKeyFrame KeyTime="0" Value="100"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="240"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image">
                    <EasingDoubleKeyFrame KeyTime="0" Value="100"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="240"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

And I have such C# code for handling event that image loaded and opened:

    private void Image_ImageOpened(object sender, RoutedEventArgs e)
    {
        Storyboard.SetTarget(PopupImageStoryboard, sender as Image);
        PopupImageStoryboard.Begin();
    }

It does not work, I can not change target and rerun same storyboard while it is running. But I want multiple images run this animation simultaneously. Can you recommend any solution for animation reuse ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:10:08+00:00Added an answer on June 16, 2026 at 3:10 am

    You should remove this from each of the child animations:

    Storyboard.TargetName="image"
    

    Then also I think a single Storyboard might not be possible to be used on two target elements at the same time, so the solution for that would be to put it in a DataTemplate, e.g.

    <Page.Resources>
        <DataTemplate
            x:Name="myStoryboard">
            <Storyboard ... />
        </DataTemplate>
    </Page.Resources>
    

    Then in code you would say

    var sb = (Storyboard)myStoryboard.LoadContent();
    Storyboard.SetTarget(sb, sender as Image);
    sb.Begin();
    

    BTW – do not animate Width and Height properties. This is almost certainly not the best idea in your case. You should animate your RenderTransform properties instead, e.g. targeting ScaleTransform’s ScaleX and ScaleY properties. If an animation is a dependent – it will cause layout updates in each frame which is very inefficient and will degrade your animation frame rate.

    *EDIT

    A better solution then would look like this:

    <Page.Resources>
        <DataTemplate
            x:Name="myStoryboardTemplate">
            <Storyboard>
                <DoubleAnimation
                    Storyboard.TargetProperty="ScaleX"
                    From="0.5"
                    To="1.0"
                    Duration="0:0:0.4">
                    <DoubleAnimation.EasingFunction>
                        <BackEase
                            Amplitude="2"
                            EasingMode="EaseOut"/>
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation
                    Storyboard.TargetProperty="ScaleY"
                    From="0.5"
                    To="1.0"
                    Duration="0:0:0.4">
                    <DoubleAnimation.EasingFunction>
                        <BackEase
                            Amplitude="2"
                            EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
            </Storyboard>
        </DataTemplate>
    </Page.Resources>
    

    …

    <Image
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Width="620"
        Height="300"
        Source="Assets/SplashScreen.png"
        RenderTransformOrigin="0.5,0.5"
        Stretch="Fill">
        <Image.RenderTransform>
            <ScaleTransform
                x:Name="imageScaleTransform" />
        </Image.RenderTransform>
    </Image>
    

    …

    void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        var sb = (Storyboard)myStoryboardTemplate.LoadContent();
        Storyboard.SetTarget(sb, imageScaleTransform);
        sb.Begin();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a Windows Store App that uses a GridView to show a list
I'm building a windows phone 7 application using silverlight 4. I store my data
I'm building a Windows Store app and I'm failing the App Certification Tool test
I have this Metro App project that I just tried building for the Windows
I'm building a windows store app and I need to trigger the Manipulation(Delta) of
I'm building a Windows Store App and I have a TextBox binded (two-way mode)
I’m building a Windows 8 Store app and I’m having trouble with a CollectionViewSource
I'm building a UI in XAML for a Windows Store app; it uses two
I am building a windows application to store backups of sensitive files. The purpose
I'm building a Windows Store App using the Windows Runtime. I'm accessing an OData

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.