예제 #1
0
        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);
        }
예제 #2
0
 public MirWidget WithAnimation(WidgetAnimation animation)
 {
     _animations.Add(animation);
     animation.Attach(this);
     return(this);
 }