[Proposal] Animation Behavior
See original GitHub issueAnimation Behavior
- Proposed
- Prototype
- Implementation
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests
- Documentation: https://github.com/MicrosoftDocs/CommunityToolkit/pull/121
- Sample: https://github.com/CommunityToolkit/Maui/blob/main/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/AnimationBehaviorPage.xaml
Summary
AnimationBehavor
is a Behavior
that can be attached to any VisualElement
, allowing developers to trigger the following animations via ICommand AnimateCommand
:
- #519
- FlipHorizontalAnimation
- FlipVerticalAnimation
- RotateAnimation
- ScaleAnimation
- ShakeAnimation
Motivation
AnimationBehavior
solves the following challenges:
- Animations are not easily accomplished in XAML
- Animations are not easily accomplished using
ICommand
Following the implementation of AnimationBehavior
, developers will easily be able to create bindable animations for any VisualElement
Detailed Design
AnimationBehavior.shared.cs
AnimationBehavior
is a Behavior
can be attached to any VisualElement
.
AnimationBehavior
implements EventToCommandBehavior
.
public class AnimationBehavior : EventToCommandBehavior
{
public static readonly BindableProperty AnimationTypeProperty;
public static readonly BindableProperty AnimateCommandProperty;
public AnimationBase? AnimationType { get; set; }
public ICommand AnimateCommand { get; }
}
AnimationBase<TView>
AnimationBase
is an abstract
class implementing BindableObject
that allows for creating animations.
public abstract class AnimationBase<TView> : BindableObject where TView : View
{
public static readonly BindableProperty DurationProperty;
public static readonly BindableProperty EasingTypeProperty
public uint Duration { get; set; }
public Easing Easing { get; set; }
public abstract Task Animate(TView? view);
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
[Proposal] ProgressBar Animation Behavior · Issue #48
A behavior that animates a ProgressBar based on double AnimateProgress . Detailed Design. ProgressBarAnimationBehavior.shared.cs. public class ...
Read more >Animation Proposal - 10+ Examples, Format, Pdf
Learn how to compose an animation proposal by reading this article. ... Before starting to animate your motion picture, you should first conduct...
Read more >Free Animation Project Proposal Template
Customize and download any of Bonsai's animation proposal sample templates. ... The Coach agrees to maintain the ethics and standards of behavior ......
Read more >Advanced CSS Transitions & Animations Proposal
It can appear that the animation is fired by the element entering some state, but that's an illusion; there is no state-changing behavior...
Read more >A Modest Proposal for CSS3 Animations
I propose that the CSS3 Animation specification be changed to allow for this. Keyframes should act like classes being applied to an element....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you and thanks for all the hard work in getting it to this stage it really is appreciated!
Hi @bijington, I’ve unassigned myself so go for it!