Bug 42195 - Controls nested in StackLayout seem to inherit IsVisible property
Summary: Controls nested in StackLayout seem to inherit IsVisible property
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-06-27 19:38 UTC by Clint
Modified: 2016-08-18 19:58 UTC (History)
2 users (show)

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

XAML to re-produce, and screen capture of UI it creates (173.09 KB, image/png)
2016-06-27 19:38 UTC, Clint
Basic files for the PCL. (797.32 KB, application/zip)
2016-08-18 19:45 UTC, Clint

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 Clint 2016-06-27 19:38:07 UTC
Created attachment 16504 [details]
XAML to re-produce, and screen capture of UI it creates

Please see attached which shows both XAML and resulting display.
Possibly a loose connection to [confirmed] bug 33528

It seems as if the IsVisible for controls nested in a StackLayout are having their binded IsVisible state superceeded by the parent StackLayout.

Looking at this XAML, one of the two labels should be hidden if the other is visible because they are both binded to the same bool, one with a BoolInvertConverter on it.

Yet both labels are always visible and laying on top of each other.

This is easily/best seen in the attached .png
Comment 1 Rui Marinho 2016-08-08 16:11:21 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards, 
Xamarin Forms Team
Comment 2 Clint 2016-08-08 16:55:11 UTC
Ok.  I'll put a project together for you, this week.
Comment 3 Clint 2016-08-18 19:45:34 UTC
Created attachment 17110 [details]
Basic files for the PCL.

Entire solution is 180 mb and I figured you didn't want that.  The attached .zip is just the PCL project portion.  You should have no problem copy/pasting as needed into a VS solution of your own.
Comment 4 Clint 2016-08-18 19:52:30 UTC
Requested sample attached.  Its the PCL project of a Xamarin.Forms solution consisting of a XAML content page, and a ViewModel.  The entire solution is 180mb and I assume you don't want that as an attachment.  If I'm wrong and you do want it just say so.

As you can see the parent/encompassing StackLayout is bindinded to a property that makes its "IsEnabled" property false.  Yet you can click the enclosed button that will randomly change the backcolor of the page.
Comment 5 Clint 2016-08-18 19:58:06 UTC
I stand corrected.  I was looking at Bug42195 regarding IsVisible and confusing it with Bug43007 IsEnabled.  My goof.  

I changed the sample to bind to IsVisible and that does indeed work as expected.  Bug43007 IsEnabled remains confirmed.

Sorry for the mix up.