public MirWidget WithAnimation(Action <MirWidget, int> callback, int from, int to, TimeSpan elapse, bool loop = false) { var animation = WidgetAnimation.Create() .WithCallback(callback) .From(from) .To(to) .Elapse(elapse) .Attach(this); if (loop) { animation.WithLoop(); } else { animation.WithoutLoop(); } _animations.Add(animation); return(this); }
public MirWidget WithAnimation(WidgetAnimation animation) { _animations.Add(animation); animation.Attach(this); return(this); }