|
|
@ -2,14 +2,7 @@ |
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
|
|
|
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.Linq; |
|
|
|
|
|
using System.Reactive.Linq; |
|
|
|
|
|
using Avalonia.Animation.Animators; |
|
|
using Avalonia.Animation.Animators; |
|
|
using Avalonia.Animation.Utils; |
|
|
|
|
|
using Avalonia.Collections; |
|
|
|
|
|
using Avalonia.Data; |
|
|
|
|
|
using Avalonia.Reactive; |
|
|
|
|
|
|
|
|
|
|
|
namespace Avalonia.Animation |
|
|
namespace Avalonia.Animation |
|
|
{ |
|
|
{ |
|
|
@ -46,6 +39,7 @@ namespace Avalonia.Animation |
|
|
public void OnError(Exception error) |
|
|
public void OnError(Exception error) |
|
|
{ |
|
|
{ |
|
|
_lastInstance?.Dispose(); |
|
|
_lastInstance?.Dispose(); |
|
|
|
|
|
_lastInstance = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void IObserver<bool>.OnNext(bool matchVal) |
|
|
void IObserver<bool>.OnNext(bool matchVal) |
|
|
@ -53,12 +47,18 @@ namespace Avalonia.Animation |
|
|
if (matchVal != _lastMatch) |
|
|
if (matchVal != _lastMatch) |
|
|
{ |
|
|
{ |
|
|
_lastInstance?.Dispose(); |
|
|
_lastInstance?.Dispose(); |
|
|
|
|
|
|
|
|
if (matchVal) |
|
|
if (matchVal) |
|
|
{ |
|
|
{ |
|
|
_lastInstance = _animator.Run(_animation, _control, _clock, _onComplete); |
|
|
_lastInstance = _animator.Run(_animation, _control, _clock, _onComplete); |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_lastInstance = null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
_lastMatch = matchVal; |
|
|
_lastMatch = matchVal; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|