Bug 26207 - Modifying IsVisible immediately after an animation resets the animation
Summary: Modifying IsVisible immediately after an animation resets the animation
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-20 14:08 UTC by aer127
Modified: 2015-02-27 02:34 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Sample that demonstrates the bug (3.83 MB, application/x-zip-compressed)
2015-01-20 14:09 UTC, aer127

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description aer127 2015-01-20 14:08:03 UTC
Modifying the IsVisible property immediately after running an animation causes the animation to reset. For instance, running this code:

await _label.LayoutTo(new Rectangle(50f, 500f, _label.Bounds.Width, _label.Bounds.Height));
_button.IsVisible = false;

will cause the label to reset to its bounds before the animation. I have attached a simple project that demonstrates this behavior. I have verified the issue exists on Android and iOS. I have not tested Windows Phone. To see the bug, just simply press the "Animate" button in the attached sample.
Comment 1 aer127 2015-01-20 14:09:00 UTC
Created attachment 9421 [details]
Sample that demonstrates the bug
Comment 2 Atin 2015-01-21 12:19:13 UTC
We have checked this issue with the help of given sample app and observed that when we run the sample and click on "Animate" button then button "Animate" disappears, label goes to bottom of the screen and again come back to it's original position.

And we have also noticed that when we commented the line "_button.IsVisible = false;" in project and run the application again and click on "Animate" button then label goes to bottom of the screen and never back to it's original position.

Could you please have a look on screencast http:http://www.screencast.com/t/pES4AkrqSZ and confirm us if you are getting the same behaviour. 

Environment Info:

Xamarin.Forms :

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Xamarin (d6a2cae)
Comment 3 aer127 2015-01-21 12:24:29 UTC
Yes, this is the behavior I am seeing. As long as the line of code that sets the button visibility to false is commented out, the animation works correctly. Otherwise, it does not.
Comment 4 aer127 2015-01-28 13:18:39 UTC
Changing status to new....not sure if I was supposed to do this after adding comments
Comment 5 aer127 2015-02-12 16:00:28 UTC
Any updates on when this will be fixed?
Comment 6 Ram Chandra 2015-02-13 06:15:48 UTC
I have checked this issue with X.Form: and I am still getting this issue.
Comment 7 Jason Smith [MSFT] 2015-02-27 02:32:35 UTC
Use TranslateTo not LayoutTo. LayoutTo is intended for layout internal usage and does not override the items final position in a managed layout.
Comment 8 Jason Smith [MSFT] 2015-02-27 02:34:23 UTC
To add slightly.

LayoutTo is actually affecting the layout, so when the parent layout re-lays out its children (which changing IsVisible will trigger) it will just ignore whatever you did with LayoutTo. TranslateTo changes the translation properties, which are POST layout transforms. A translation of 10, 10 for example will offset an item 10 pixels down and right from where it would normally be placed. This will be retained through layout cycles.