CancelAnimations is on ViewExtensions but is not an extension method?

AndyHopperAndyHopper USMember ✭✭
edited October 2014 in Xamarin.Forms

The CancelAnimations method is present on XF.ViewExtensions, but is not set up as an extension method. Was this intentional?
(XF 1.2.3, btw)

Thanks!

Posts

  • LudovicThomasLudovicThomas USMember ✭✭

    +1 on that question.
    Was using it last week, and asking the same. It seems to be an error?

  • RichardShawRichardShaw USMember

    I ran across this hiccup as well, but in the meantime, I have done the following until they fix it

        /* Globally available utility file */
        public static class FixedViewExtensions
        {
            public static void CancelAllAnimations (this Xamarin.Forms.VisualElement view) 
            {
                if(view == null)
                    throw new ArgumentNullException(@"view");
    
                Xamarin.Forms.ViewExtensions.CancelAnimations(view);
            }
        }
    
        /* Some Page/View */
    
        void DoStuff () 
        {
            var myButton = new Button();
            await myButton.FadeTo(.10, 10000, Easing.CubicInOut);
            myButton.CancelAllAnimations();
        }
    

    Slight adjustment to the name of the cancel method, just in case the Xamarin.Forms team comes in and fixes their method to be, well, an extension method!

  • powerdudepowerdude USMember ✭✭

    @AndyHopper @RichardShaw , @LudovicThomas , hopefully someone posted a bug at http://bugzilla.xamarin.com as there's no guarantee anyone on the Xamarin team will actually see this post in order to do something about this.

Sign In or Register to comment.