Skip to content

Commit 4bc18c7

Browse files
committed
Removed IInternalImplicitAnimation, moved event to public interface
See #3843 (comment)
1 parent e18c3bb commit 4bc18c7

File tree

4 files changed

+12
-33
lines changed

4 files changed

+12
-33
lines changed

Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Abstract/ImplicitAnimation{TValue,TKeyFrame}.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
1515
/// A base model representing a typed animation that can be used as an implicit composition animation.
1616
/// </summary>
1717
/// <inheritdoc cref="Animation{TValue, TKeyFrame}"/>
18-
public abstract class ImplicitAnimation<TValue, TKeyFrame> : Animation<TValue, TKeyFrame>, IImplicitTimeline, IInternalImplicitAnimation
18+
public abstract class ImplicitAnimation<TValue, TKeyFrame> : Animation<TValue, TKeyFrame>, IImplicitTimeline
1919
where TKeyFrame : unmanaged
2020
{
21-
/// <inheritdoc cref="IInternalImplicitAnimation.AnimationPropertyChanged"/>
22-
private event EventHandler? AnimationPropertyChanged;
21+
/// <inheritdoc/>
22+
public event EventHandler? AnimationPropertyChanged;
2323

2424
/// <summary>
2525
/// Initializes a new instance of the <see cref="ImplicitAnimation{TValue, TKeyFrame}"/> class.
@@ -37,13 +37,6 @@ protected ImplicitAnimation()
3737
RegisterPropertyChangedCallback(KeyFramesProperty, RaiseAnimationPropertyChanged);
3838
}
3939

40-
/// <inheritdoc/>
41-
event EventHandler? IInternalImplicitAnimation.AnimationPropertyChanged
42-
{
43-
add => AnimationPropertyChanged += value;
44-
remove => AnimationPropertyChanged -= value;
45-
}
46-
4740
/// <summary>
4841
/// Gets or sets the optional implicit target for the animation. This can act as a trigger property for the animation.
4942
/// </summary>

Microsoft.Toolkit.Uwp.UI.Animations/Xaml/ImplicitAnimationSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private void ImplicitAnimationSetVectorChanged(IObservableVector<DependencyObjec
6262
if (@event.CollectionChange == CollectionChange.ItemInserted ||
6363
@event.CollectionChange == CollectionChange.ItemChanged)
6464
{
65-
IInternalImplicitAnimation item = (IInternalImplicitAnimation)sender[(int)@event.Index];
65+
IImplicitTimeline item = (IImplicitTimeline)sender[(int)@event.Index];
6666

6767
item.AnimationPropertyChanged -= RaiseAnimationsChanged;
6868
item.AnimationPropertyChanged += RaiseAnimationsChanged;

Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Interfaces/IImplicitTimeline.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System;
56
using Windows.UI.Composition;
67
using Windows.UI.Xaml;
78

@@ -14,6 +15,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
1415
/// </summary>
1516
public interface IImplicitTimeline
1617
{
18+
/// <summary>
19+
/// Raised whenever a property that influences the animation changes.
20+
/// This event is used by <see cref="ImplicitAnimationSet"/> to update the animations collection
21+
/// assigned to a target <see cref="UIElement"/> when any of the individual animations is modified.
22+
/// </summary>
23+
event EventHandler? AnimationPropertyChanged;
24+
1725
/// <summary>
1826
/// Gets a <see cref="CompositionAnimation"/> from the current node. This animation might
1927
/// be used either as an implicit show/hide animation, or as a direct implicit animation.

Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Interfaces/IInternalImplicitAnimation.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)