Bug 37667 - [WP] RelativeLayout Inside A RelativeLayout Ignores Initial IsVisible Property
Summary: [WP] RelativeLayout Inside A RelativeLayout Ignores Initial IsVisible Property
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-01-13 22:20 UTC by Jimmy [MSFT]
Modified: 2017-09-07 03:41 UTC (History)
3 users (show)

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


Attachments
repro solution (122.83 KB, application/zip)
2016-01-13 22:20 UTC, Jimmy [MSFT]
Details


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:
Status:
RESOLVED NOT_ON_ROADMAP

Description Jimmy [MSFT] 2016-01-13 22:20:45 UTC
Created attachment 14576 [details]
repro solution

### Overview
On Windows Phone, a RelativeLayout inside another RelativeLayout will always be visible when it is first rendered even if IsVisible = false.


### Steps to Reproduce
1. Run the attached Windows Phone project


### Expected Results
The blue RelativeLayout will not be visible.


### Actual Results 
The blue RelativeLayout is visible even though IsVisible is set to false in XAML. The button is supposed to toggle between visibility states, but the first press does not hide the layout. Only after subsequent presses does the layout’s visibility toggle. This makes me think that the issue is the native FrameworkElement not being in sync with the RealtiveLayout’s IsVisible property.


### Workaround
Use a custom renderer for the inner RelativeLayout and inside OnElementChanged() set

> this.Visibility = Visibility.Collapsed;


### Environment
Reproduced the issue with Form 2.0.0 and 2.0.1-pre1. However, the issue doesn’t exist in version 1.5.1.