[SOLVED] Animation not working?

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
Andreas
Posts: 13
Joined: Mon Dec 03, 2018 3:30 am

[SOLVED] Animation not working?

Postby Andreas » Wed Dec 19, 2018 8:51 am

Hi,

I'm trying to recreate the animation example from the showcase.
I've created an empty cs xaml for html5 project and copied the relevant code.
For some reason the animation doesn't play. The showcase works without any issue.
Any idea what the reason could be?

Thanks,
Andreas

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Animation not working?

Postby JS-Support @Userware » Wed Dec 19, 2018 8:59 am

Hi,

Could you please attach the test project? (you can delete the bin and obj folders before uploading the ZIP)

Andreas
Posts: 13
Joined: Mon Dec 03, 2018 3:30 am

Re: Animation not working?

Postby Andreas » Thu Dec 20, 2018 12:58 am

Hi Folks,

Pls find the test project attached.

Thanks,
Andreas
Attachments
AnimationTest.zip
(7.73 KiB) Downloaded 336 times

Andreas
Posts: 13
Joined: Mon Dec 03, 2018 3:30 am

Re: Animation not working?

Postby Andreas » Mon Jan 14, 2019 1:47 am

Any luck with this?

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Animation not working?

Postby JS-Support @Userware » Mon Jan 21, 2019 6:50 am

Hi Andreas,

Sorry for the delay to reply.

The issue is caused by the fact that you have inverted the methods "ButtonToStartAnimationClose_Click" and "ButtonToStartAnimationOpen_Click", so that when you click the "Start" button, it launches the wrong animation (it launches the "Close" animation instead of the "Open" one).

To fix the issue, please replace the following code:

Code: Select all

        private void ButtonToStartAnimationClose_Click(object sender, RoutedEventArgs e)
        {
            var storyboard = (Storyboard)CanvasForAnimationsDemo.Resources["AnimationToOpen"];
            storyboard.Begin();
            ButtonToStartAnimationOpen.Visibility = Visibility.Collapsed;
            ButtonToStartAnimationClose.Visibility = Visibility.Visible;
        }

        private void ButtonToStartAnimationOpen_Click(object sender, RoutedEventArgs e)
        {
            var storyboard = (Storyboard)CanvasForAnimationsDemo.Resources["AnimationToClose"];
            storyboard.Begin();
            ButtonToStartAnimationOpen.Visibility = Visibility.Visible;
            ButtonToStartAnimationClose.Visibility = Visibility.Collapsed;
        }


with this one:

Code: Select all

        private void ButtonToStartAnimationOpen_Click(object sender, RoutedEventArgs e)
        {
            var storyboard = (Storyboard)CanvasForAnimationsDemo.Resources["AnimationToOpen"];
            storyboard.Begin();
            ButtonToStartAnimationOpen.Visibility = Visibility.Collapsed;
            ButtonToStartAnimationClose.Visibility = Visibility.Visible;
        }

        private void ButtonToStartAnimationClose_Click(object sender, RoutedEventArgs e)
        {
            var storyboard = (Storyboard)CanvasForAnimationsDemo.Resources["AnimationToClose"];
            storyboard.Begin();
            ButtonToStartAnimationOpen.Visibility = Visibility.Visible;
            ButtonToStartAnimationClose.Visibility = Visibility.Collapsed;
        }


Thanks
Regards

Andreas
Posts: 13
Joined: Mon Dec 03, 2018 3:30 am

Re: Animation not working?

Postby Andreas » Mon Jan 21, 2019 7:29 am

Indeed! Sometimes a second pair of eyes is all that's needed.
Thanks for taking the time to look at this! Stupid mistake....

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Animation not working?

Postby JS-Support @Userware » Mon Jan 21, 2019 7:58 am

No problem, thanks a lot!


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 48 guests

 

 

cron