Esempio n. 1
0
        private void AnimateButtonTouched(Xamarin.Forms.View view, uint duration, string hexColorInitial, string hexColorFinal, int repeatCountMax)
        {
            var repeatCount = 0;

            view.Animate("changedBG", new Animation((val) => {
                if (repeatCount == 0)
                {
                    view.BackgroundColor = Color.FromHex(hexColorInitial);
                }
                else
                {
                    view.BackgroundColor = Color.FromHex(hexColorFinal);
                }
            }), duration, finished: (val, b) => {
                repeatCount++;
            }, repeat: () => {
                return(repeatCount < repeatCountMax);
            });
        }
 private Task Scale(View content, Easing easing, double start, double end, bool isAppearing)
 {
     TaskCompletionSource<bool> task = new TaskCompletionSource<bool>();
     
     content.Animate("popIn", d =>
     {
         content.Scale = d;
     }, start, end,
     easing: easing,
     length: isAppearing ? DurationIn : DurationOut,
     finished: (d, b) =>
     {
         task.SetResult(true);
     });
     return task.Task;
 }