Monolith is a Windows library that lets you create animations in codebehind in a fluent, somewhat straightforward manner. It's a wrapper around the Windows.UI.Xaml.Media.Animation library that removes as much of the setup as possible.
using Lousy.Mon;
// Create an ease for use with animations later
ExponentialEase ExpEaseOut =
new ExponentialEase() { EasingMode = EasingMode.EaseOut };
// Animate a UIElement along the X axis from 0 to 40
Oli.MoveXOf(uiElem).From(0).To(40).For(0.3, OrSo.Secs).Now();
// Rotate UIElement to 90 degrees
EventToken rotating =
Oli.Rotate(uiElem).To(90).For(0.3, OrSo.Secs).With(ExpEaseOut).Now();
// Fade the opacity to 0 after the rotation finishes
Oli.Fade(uiElem).To(0).For(0.3, OrSo.Secs).With(ExpEaseOut).After(rotating);
// Run arbitrary code after the rotation too!
Oli.Run(() =>
{
// Do things here!
}).After(rotating);
Check out Monolith on NuGet!
PM> Install-Package Monolith
- Clone this git repo and include the .csproj file in your solution
- Reference Monolith.dll under ../Monolith/bin/ once you compile
- Hack away!
- Using .After(double duration, OrSo type) on successively on the same object with the same animation type is broken (the last call overwrites the previous ones) and it requires an architectural change to fix. Use .After(EventToken token, double duration, OrSo type) instead
- Setting AndReverseIt() on an animation that is chained to another animation will animate, but will jump to the wrong To() value after the animation ends
HA HAHAHA HAHA
Please contact me if you want to help write tests
Tweet me @ThatLousyGuy if you'd like to help contribute! I've only been adding features as I need them, so if you have an idea for a feature that'd be useful, we should chat about it :D