void renderer_NodeRendering(object sender, NodeRenderingEventArgs e) { if (NodeRendering != null) { NodeRendering(this, e); } var timestampNode = e.Node as WebVTTTimestampNode; if (timestampNode != null) { var animation = new Animation(e.Cue, timestampNode.Timestamp); var previousForeground = e.Inline.Foreground; animation.OnEnable = () => e.Inline.Foreground = previousForeground; animation.OnDisable = () => e.Inline.Foreground = new SolidColorBrush(Colors.Transparent); animation.OnDisable(); // force the state to be consistent with animation.IsEnabled animations.Add(animation); } }
void renderer_NodeRendering(object sender, NodeRenderingEventArgs e) { if (NodeRendering != null) NodeRendering(this, e); var timestampNode = e.Node as WebVTTTimestampNode; if (timestampNode != null) { var animation = new Animation(e.Cue, timestampNode.Timestamp); var previousForeground = e.Inline.Foreground; animation.OnEnable = () => e.Inline.Foreground = previousForeground; animation.OnDisable = () => e.Inline.Foreground = new SolidColorBrush(Colors.Transparent); animation.OnDisable(); // force the state to be consistent with animation.IsEnabled animations.Add(animation); } }