private static void OnShowStoryboardChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue == e.OldValue)
            {
                return;
            }

            var element = d as FrameworkElement;

            if (element == null)
            {
                throw new ArgumentException("d");
            }

            var entry = s_entries.GetOrCreate(element, () => new EntryInfo());

            if (entry.ShowStoryboard != null)
            {
                ShowHideAnimation.UnhandleShowStoryboardCompletedEvent(element);
            }

            if (e.NewValue == null)
            {
                entry.ShowStoryboard = null;
            }
            else
            {
                entry.ShowStoryboard = (Storyboard)((Freezable)e.NewValue).Clone();
            }
        }
        static void ShowStoryboard_Completed(FrameworkElement element, object sender, EventArgs e)
        {
            EntryInfo entry;

            if (s_entries.TryGetValue(element, out entry))
            {
                ShowHideAnimation.UnhandleShowStoryboardCompletedEvent(element);
                if (entry.ContentHolder != null)
                {
                    entry.ContentHolder.Visibility = Visibility.Visible;
                }
                if (entry.SnapshotHolder != null)
                {
                    entry.SnapshotHolder.Visibility = Visibility.Hidden;
                }
            }
        }