private void AnimateHeight(double containerHeight, DependencyObject target) { var heightStoryBoard = new Storyboard(); var heightAnimation = AnimationUtilities.PrepareAnimation(0, containerHeight, target, HeightProperty, 0.3f); //var widthAnimation = AnimationUtilities.PrepareAnimation(10, containerWidth, target, WidthProperty, 1); heightStoryBoard.Children.Add(heightAnimation); heightStoryBoard.Begin(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { var animation = AnimationUtilities.PrepareAnimation(10, Width, this, WidthProperty, 0.7f); this.BeginAnimation(WidthProperty, animation); }