Storyboard sb = new Storyboard(); ObjectAnimationUsingKeyFrames objAn = new ObjectAnimationUsingKeyFrames(); objAn.BeginTime = TimeSpan.FromSeconds(0); Storyboard.SetTarget(objAn, dock); Storyboard.SetTargetProperty(objAn, new PropertyPath(UIElement.VisibilityProperty)); DiscreteObjectKeyFrame objd = new DiscreteObjectKeyFrame(Visibility.Visible, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0))); objAn.KeyFrames.Add(objd); DiscreteObjectKeyFrame objd1 = new DiscreteObjectKeyFrame(Visibility.Hidden, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))); objAn.KeyFrames.Add(objd1); sb.Children.Add(objAn); sb.BeginAnimation(UIElement.VisibilityProperty, objAn);
dock
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)