protected IDisposable BeginStoryboard() { if (_currentStoryboardDisposable != null) throw new InvalidOperationException("You cannot call BeginStoryboard without running the storyboard you began with a previous call."); _currentStoryboardDisposable = new StoryboardDisposable(new Storyboard()); _currentStoryboardDisposable.Disposed += CleanupStoryboardDisposable; return _currentStoryboardDisposable; }
private void CleanupStoryboardDisposable() { _currentStoryboardDisposable = null; }