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 6983107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:22:32+00:00 2026-05-27T18:22:32+00:00

I have a double animation, where the window gets scaled down and moved to

  • 0

I have a double animation, where the window gets scaled down and moved to the side. I do this in the Window_Deactivated event. The code is below:

        <Storyboard x:Key="StoryTestScaleDownGrd1">

        <DoubleAnimation Storyboard.TargetName="ScaleUp" Storyboard.TargetProperty="ScaleX" 
                       From="1" To=".20" Duration="0:0:.25" BeginTime="00:00:00" />

        <DoubleAnimation Storyboard.TargetName="ScaleUp" Storyboard.TargetProperty="ScaleY" 
                       From="1" To=".20" Duration="0:0:.25" BeginTime="00:00:00" />            

        <DoubleAnimation Storyboard.TargetName="MoveCenter1" Storyboard.TargetProperty="OffsetX"
                         Duration="0:0:.25" BeginTime="00:00:00.25" />

        <DoubleAnimation Storyboard.TargetName="MoveCenter1" Storyboard.TargetProperty="OffsetY" 
                         Duration="0:0:.25" BeginTime="00:00:00.25"/>

    </Storyboard>

In the Window_Activated event, I have the code below:

        <Storyboard x:Key="StoryTestScaleUpGrd1">

        <DoubleAnimation Storyboard.TargetName="ScaleUp" Storyboard.TargetProperty="ScaleX" 
                       From=".20" To="1" Duration="0:0:.25" BeginTime="00:00:00.75" />

        <DoubleAnimation Storyboard.TargetName="ScaleUp" Storyboard.TargetProperty="ScaleY" 
                         From=".20" To="1" Duration="0:0:.25" BeginTime="00:00:00.75" />

        <DoubleAnimation Storyboard.TargetName="MoveCenter1" Storyboard.TargetProperty="OffsetX" 
                        Duration="0:0:.25" BeginTime="00:00:00.5" />

        <DoubleAnimation Storyboard.TargetName="MoveCenter1" Storyboard.TargetProperty="OffsetY" 
                        Duration="0:0:.25" BeginTime="00:00:00.5" />

    </Storyboard>

My viewport2dvisual3d is below:

        <Viewport2DVisual3D.Transform>
            <Transform3DGroup>

                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D x:Name="Win1Angle" Angle="0" Axis="0, 1, 0" />
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>

                <ScaleTransform3D x:Name="ScaleUp"  />
                <ScaleTransform3D x:Name="ScaleDown"  />

                <TranslateTransform3D x:Name="MoveCenter1" OffsetX="0" OffsetY="0" />

            </Transform3DGroup>
        </Viewport2DVisual3D.Transform>


        <!-- The Geometry, Material, and Visual for the Viewport2DVisual3D -->
        <Viewport2DVisual3D.Geometry>
            <!-- positions of triangle    0          1           2           3      -->

            <MeshGeometry3D Positions="-.78,.58,0  -.78,-.58,0    .78,-.58,0    .78,.58,0"                                
                                    TextureCoordinates="0,0 0,1 1,1 1,0" 
                                    TriangleIndices="0 1 2 0 2 3" />

        </Viewport2DVisual3D.Geometry>

        <Viewport2DVisual3D.Material>
            <DiffuseMaterial  Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
        </Viewport2DVisual3D.Material>

        <Grid x:Name="grdHolder1" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="False" Opacity="1" />

    </Viewport2DVisual3D>

The code for doing the animation is below:

window deactivated

StoryDeActivatedGrd1 = (Storyboard)this.Resources["StoryTestScaleDownGrd1"];


  (StoryDeActivatedGrd1.Children[2] as DoubleAnimation).From = 0.0;
            (StoryDeActivatedGrd1.Children[2] as DoubleAnimation).To = (double)GV.oCoOrdinate.XValue;
            (StoryDeActivatedGrd1.Children[3] as DoubleAnimation).From = 0.0;
            (StoryDeActivatedGrd1.Children[3] as DoubleAnimation).To = (double)GV.oCoOrdinate.YValue;
            StoryDeActivatedGrd1.Begin();

In the activated event, I have the following code:

 StoryActivatedGrd1 = (Storyboard)this.Resources["StoryTestScaleUpGrd1"];

 (StoryActivatedGrd1.Children[2] as DoubleAnimation).To = 0.0;
                (StoryActivatedGrd1.Children[3] as DoubleAnimation).To = 0.0;
                StoryActivatedGrd1.Begin();

My problem is that, my window is extremely small when the window gets activated. Is there a way we can reset the window size after the first animation?

Actually, I use two grids to hold the usercontrols at runtime, I have the first grid working easily, but when the window flips to the second usercontrol, I have the problem as above…

  • 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-05-27T18:22:32+00:00Added an answer on May 27, 2026 at 6:22 pm

    If you want to reset animated property to it`s original state you can set FillBehavior property to Stop on Animations that alter that property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have double numba = 5212.6312 String.Format({0:C}, Convert.ToInt32(numba) ) This will give
Before I start, I have this code inside of a Custom Usercontrol: private DependencyProperty
How would I reverse a double animation in Silverlight on an event? For example,
I have extracted this piece of code from my project, because I was trying
In my current application I have this little animation. It makes a full 360
I have user control with property public double X { get { return Canvas.GetLeft(this)
I have something like this: barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation( barProgress.Value, dNextProgressValue, new Duration(TimeSpan.FromSeconds(dDuration))); Now, how
I have double (or float) variables that might be empty, as in holding no
I have a specific requirement that all children of a particular JComponent have double
I'm looking to slice a two dimensional array in C#. I have double[2,2] prices

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.