protected override void ValidateCore()
 {
     base.ValidateCore();
     if (this.keyFramesDirty)
     {
         this.RebuildKeyFrames();
         this.keyFramesDirty = false;
         this.OnPropertyChanged("HasAnimationVisual");
     }
     this.HasAnimation = false;
     this.DescendantOnlyHasAnimation = false;
     foreach (TimelineItem timelineItem in (Collection <TimelineItem>) this.Children)
     {
         AnimationTimelineItem animationTimelineItem = timelineItem as AnimationTimelineItem;
         if (animationTimelineItem != null && animationTimelineItem.IsInActiveTimeline)
         {
             this.HasAnimation = true;
             break;
         }
         CompoundKeyFrameTimelineItem frameTimelineItem = timelineItem as CompoundKeyFrameTimelineItem;
         if (frameTimelineItem != null)
         {
             if (!frameTimelineItem.IsCompoundKeyFrameRoot && frameTimelineItem.HasAnimation)
             {
                 this.HasAnimation = true;
                 break;
             }
             if (frameTimelineItem.HasAnimation || frameTimelineItem.DescendantOnlyHasAnimation)
             {
                 this.DescendantOnlyHasAnimation = true;
             }
         }
     }
     this.OnPropertyChanged("HasAnimationVisual");
 }
 private void DirtyKeyFrames()
 {
     for (CompoundKeyFrameTimelineItem frameTimelineItem = this; frameTimelineItem != null && !frameTimelineItem.keyFramesDirty; frameTimelineItem = frameTimelineItem.Parent as CompoundKeyFrameTimelineItem)
     {
         frameTimelineItem.keyFramesDirty = true;
         if (frameTimelineItem.IsCompoundKeyFrameRoot)
         {
             break;
         }
     }
     this.Invalidate();
 }