0

I'm looking for a solution to my WPF project.

I've an User Control with 2 different widget inside. The first one animates the second with this function and the animation works fine:

 private void expandTable(UIElement expandleft)
    {
       DoubleAnimation da = new DoubleAnimation(0, 700, TimeSpan.FromSeconds(0.5));
       da.AutoReverse = false;
       expandleft.BeginAnimation(Button.WidthProperty, da);
    }

The point is: this user control is into a StackPanel on another page and what I want to do is animate the width of this StackPanel with the same animation. But the above animation doesn't work as I want because the width of my StackPanel has to change according to the Width of the UserControl which in turn depends on the animation of the first Widget.

My answer is: how can I do something like that?:

 private void expandStack(UIElement expand)
{
   DoubleAnimation db = new DoubleAnimation(0, **auto**, TimeSpan.FromSeconds(0.5));
   db.AutoReverse = false;
   expan.BeginAnimation(StackPAnel.WidthProperty, db);
}

Hope I was clear. Thanks to everyone!

Shhilvia
  • 3
  • 2

0 Answers0