private void Play() { if (Children != null && Children.Count > 0) { for (int i = 0; i < Children.Count; i++) { ITimeline child = Children[i]; DisposeChildRegistrations(child); _runningChildren++; child.RegisterListener(this); child.Begin(); } } else { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // No children, so we complete immediately State = TimelineState.Stopped; OnCompleted(); }); } }
private void Play() { if (Children != null && Children.Count > 0) { for (int i = 0; i < Children.Count; i++) { ITimeline child = Children[i]; DisposeChildRegistrations(child); _runningChildren++; child.Completed += Child_Completed; child.Failed += Child_Failed; _childrenSubscriptions.Add( child, Disposable.Create(() => { child.Completed -= Child_Completed; child.Failed -= Child_Failed; }) ); child.Begin(); } } else { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // No children, so we complete immediately State = TimelineState.Stopped; OnCompleted(); }); } }