-
Notifications
You must be signed in to change notification settings - Fork 457
AnimationBehavior enhancements: #1180
Conversation
- AnimateCommand now lets the animation be triggered from a Command
src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Animations/AnimationBehavior.shared.cs
Outdated
Show resolved
Hide resolved
|
||
behavior.AnimateCommand.Execute(null); | ||
|
||
Assert.That(mockAnimation.HasAnimated, Is.True); |
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.
Assert.IsTrue(mockAnimation.HasAnimated)
?
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.
Do you want me to resolve these now that I have actioned them?
Assert.That(mockAnimation.HasAnimated, Is.True); | ||
} | ||
|
||
class MockAnimationType : AnimationBase |
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.
can you please move this class to Mocks folder?
@@ -7,12 +10,25 @@ public class AnimationBehavior : EventToCommandBehavior | |||
public static readonly BindableProperty AnimationTypeProperty = | |||
BindableProperty.Create(nameof(AnimationType), typeof(AnimationBase), typeof(AnimationBehavior)); | |||
|
|||
public static readonly BindablePropertyKey AnimateCommandPropertyKey = |
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.
should be internal
nameof(AnimateCommand), | ||
typeof(ICommand), | ||
typeof(AnimationBehavior), | ||
null, |
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.
null is fine, but also you may use "default" keyword
src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Animations/AnimationBehavior.shared.cs
Outdated
Show resolved
Hide resolved
- tidy up based on code review comments
@bijington are you able to write the docs for this feature? |
Yes of course. At first I thought there wasn't much at all for AnimationBehavior but I have found this which I should be able to update easily enough. https://github.com/MicrosoftDocs/xamarin-communitytoolkit/blob/master/docs/behaviors/animationbehavior.md I will aim to fork and submit a PR to that repo over the weekend |
Could you please resolve conflicts? |
@pictos the documentation PR is here: MicrosoftDocs/xamarin-communitytoolkit#115 I assume you want to wait for that to be merged before accepting this? @AndreiMisiukevich merge conflicts have been resolved |
@bijington can you please double-check your merge? Looks like something went wrong. |
Oh dear. I'm not sure what I've done. I thought I had just rebased off develop. |
@bijington I'll see if I can fix it (: |
@pictos oh thank you! I'm happy to try and see if I can fix it first to not take up your time |
@bijington try this, on your terminal type If the project builds and runs as expected, just do a force push |
@pictos Great thanks. I will try that out in a little bit and tidy up my mess 🙂 |
@pictos I am a little confused now. I definitely want to keep the commit from I am starting to think I should have branched off |
@bijington Ooh, I see now, you didn't create another branch to do this fix... Yeah, this can cause some confusion... I would say to delete the |
@pictos thank you for the assistance, this latest set of changes looks much more like what you are expecting :). Sorry about the mess I created. I will make sure to branch in future to simplify the merging |
No need to be sorry, as I said before git can be tricky sometimes. Glad that you were able to fix all :D |
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.
@bijington thanks for this PR, I'm awaiting for the next ones❣
Thank you for accepting the change and all the help getting it merged! This one had a big benefit for me, I will try to see if I can find something else to help out on. Keep up the great work! I have been surprised at how useful this toolkit has been for my project! |
Description of Change
Addition of
AnimateCommand
to theAnimationBehavior
class which lets the animation be triggered from a read-onlyCommand
.Bugs Fixed
API Changes
Added:
ICommand AnimationBehavior.AnimateCommand { get; }
Behavioral Changes
PR Checklist
approved
develop
this time