-
Couldn't load subscription status.
- Fork 1.4k
Minor API tweaks to the Animations package #3734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor API tweaks to the Animations package #3734
Conversation
|
Thanks Sergio0694 for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I like your idea about the behavior name too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also rename the AnimationBehaviors as you suggested to have consistent API naming. Having a Completed event raised by an AnimationEndBehavior is a bit confusing (how do "end" and "complete" differ?). Maybe we should call the end behavior "AnimationCompletionBehavior"?
| public event EventHandler? Started; | ||
|
|
||
| /// <summary> | ||
| /// Raised whenever the current animation ends. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should update the documentation here to "Raised whenever the current animation completes." to match the API wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, makes perfect sense. Done in 9d4cdce, thanks! 😄
I'm wondering keeping the same event name might be simpler and more intuitive to use? |
|
I see that "Completion" and "Completed" is not the same and that this would be different to "ItemClickBehavior" where "Click" is also the event name. However I don't think that there will be an event called "Completion". To me "AnimationCompletionBehavior" sounds better than "AnimationCompletedBehavior" but both are fine to me, most importantly, it shouldn't be "AnimationEndBehavior" (which naming scheme wise is the same as "AnimationCompletionBehavior" since the event was named "Ended" not "End"). |
Microsoft.Toolkit.Uwp.UI.Animations/Microsoft.Toolkit.Uwp.UI.Animations.csproj
Show resolved
Hide resolved
|
Yeah, agree with @chingucoding that we shouldn't use 'End'. I think sticking with the names of the Events we're hooking into makes things clear to map and to understand, so I think that'd lead us to |
|
Actually, just thinking this is really a So we probably want this to be Not sure if there's other things we've added in the Behaviors that don't follow this pattern... like thinking of my |
b586bc2 to
2211a58
Compare
2211a58 to
7b4acf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
@chingucoding if it looks good to you too - just approve, and we'll get someone to merge. 🙂 FYI @Kyaa-dost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing @michael-hawker, looks good to me!
PR Type
What kind of change does this PR introduce?
Overview
This PR makes a couple of minor changes to the public API surface of
Microsoft.Toolkit.Uwp.UI.Animations:AnimationSet.EndedtoCompleted. This is consistent withTimeline.CompletedandCompositionScopedBatch.Completed.AnimationSet.INodeinterface. This was used originally to enforce compile time type safety to nodes being added to a set, but since now we're forced to inherit fromDependencyObjectCollectionanyway, it means we would no longer have this ability anyway, as that allows consumers to append objects of any type. Instead, I've removed the interface to simplify the public API surface, and added more helpful error messages to the exception being throw in case users pass in an invalid object.Open questions
I'm thinking we might want to also rename
AnimationStartBehaviorandAnimationEndBehaviortoAnimationStartedBehaviorandAnimationCompletedBehavior? Thoughts? 🤔PR Checklist
Please check if your PR fulfills the following requirements:
Pull Request has been submitted to the documentation repository instructions. Link:Sample in sample app has been added / updated (for bug fixes / features)Icon has been created (if new sample) following the Thumbnail Style Guide and templatesContains NO breaking changes