public static void zoom(FrameworkElement item, double to, int msec, Action <object, EventArgs> callback) { double globalOffsetZ = TransformUtil.GetGlobalOffsetZ(item); Storyboard storyboard = new Storyboard(); DoubleAnimation doubleAnimation1 = new DoubleAnimation(); doubleAnimation1.From = new double?(globalOffsetZ); doubleAnimation1.To = new double?(to); doubleAnimation1.Duration = new Duration(new TimeSpan(0, 0, 0, 0, msec)); DoubleAnimation doubleAnimation2 = doubleAnimation1; Storyboard.SetTarget((Timeline)doubleAnimation2, (DependencyObject)item); Storyboard.SetTargetProperty((Timeline)doubleAnimation2, new PropertyPath("(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)", new object[0])); storyboard.Children.Add((Timeline)doubleAnimation2); if (callback != null) { storyboard.Completed += new EventHandler(callback.Invoke); } storyboard.Begin(); }