Skip to content

Commit 8d6815b

Browse files
committed
Improved XML docs for ImplicitAnimationSet
1 parent 497bd6b commit 8d6815b

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Microsoft.Toolkit.Uwp.UI.Animations/Implicit.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using Windows.Foundation.Collections;
76
using Windows.UI.Xaml;
87
using Windows.UI.Xaml.Hosting;
98

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,29 @@
1414
namespace Microsoft.Toolkit.Uwp.UI.Animations
1515
{
1616
/// <summary>
17-
/// A collection of implicit animations that can be grouped together. This type represents a composite animation
18-
/// (such as <see cref="Windows.UI.Xaml.Media.Animation.Storyboard"/>) that is executed on a given element.
17+
/// A collection of implicit animations that can be assigned to a <see cref="UIElement"/> and configured to be run automatically
18+
/// when the element is either shown or hidden (through <see cref="Implicit.ShowAnimationsProperty"/> and <see cref="Implicit.HideAnimationsProperty"/>,
19+
/// or whenever one of the targeted properties on the underlying <see cref="Visual"/> element changes, through <see cref="Implicit.AnimationsProperty"/>.
20+
/// <para>
21+
/// Animations within an <see cref="ImplicitAnimationSet"/> should be objects implementing the <see cref="IImplicitTimeline"/> interface, such as
22+
/// types inheriting from <see cref="ImplicitAnimation{TValue, TKeyFrame}"/> (eg. <see cref="OpacityAnimation"/>, <see cref="TranslationAnimation"/>,
23+
/// <see cref="OffsetAnimation"/> and <see cref="ScaleAnimation"/>, or custom ones such as <see cref="ScalarAnimation"/> and <see cref="Vector3Animation"/>).
24+
/// Adding incompatible elements cannot be validated at build-time, but will result in a runtime crash.
25+
/// </para>
26+
/// <para>
27+
/// Animations will monitor for changes in real-time to any of their public properties. For instance, if a binding is used to dynamically update the
28+
/// <see cref="Animation{TValue, TKeyFrame}.To"/> to <see cref="Animation{TValue, TKeyFrame}.From"/> properties, the entire animation set will be
29+
/// initialized again and assigned to the underlyign <see cref="Visual"/> object for the targeted <see cref="UIElement"/>. This does not currently apply
30+
/// to changes to the <see cref="Animation{TValue, TKeyFrame}.KeyFrames"/> property though (other than the entire property being reassigned). To achieve
31+
/// dynamic updates to animation sets in that case, either leverage expression keyframes or just use code-behind to manually reinitialize the animations.
32+
/// </para>
1933
/// </summary>
34+
/// <remarks>
35+
/// An <see cref="ImplicitAnimationSet"/> instance can only be used on a single target <see cref="UIElement"/>, and it cannot be shared across multiple
36+
/// elements. Attempting to do so will result in a runtime crash. Furthermore, it is recommended not to move <see cref="IImplicitTimeline"/> instances from
37+
/// one <see cref="ImplicitAnimationSet"/> to another, and doing so might add unnecessary runtime overhead over time. If you want to apply the same animations
38+
/// to multiple elements, simply create another <see cref="ImplicitAnimationSet"/> instance and another set of animations with the same properties within it.
39+
/// </remarks>
2040
public sealed class ImplicitAnimationSet : DependencyObjectCollection
2141
{
2242
/// <summary>
@@ -29,7 +49,7 @@ public sealed class ImplicitAnimationSet : DependencyObjectCollection
2949
/// </summary>
3050
public ImplicitAnimationSet()
3151
{
32-
VectorChanged += this.ImplicitAnimationSetVectorChanged;
52+
VectorChanged += ImplicitAnimationSetVectorChanged;
3353
}
3454

3555
/// <summary>
@@ -52,7 +72,7 @@ private void ImplicitAnimationSetVectorChanged(IObservableVector<DependencyObjec
5272
}
5373

5474
/// <summary>
55-
/// Raisess the <see cref="AnimationsChanged"/> event.
75+
/// Raises the <see cref="AnimationsChanged"/> event.
5676
/// </summary>
5777
/// <param name="sender">The instance raising the event.</param>
5878
/// <param name="e">The empty <see cref="EventArgs"/> for the event.</param>

0 commit comments

Comments
 (0)