Bug 27336 - Page visibility
Summary: Page visibility
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-02-23 21:00 UTC by João Vitor
Modified: 2015-06-22 11:26 UTC (History)
4 users (show)

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

Bug repdocution project. (378.27 KB, application/zip)
2015-05-26 12:30 UTC, João Vitor

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 João Vitor 2015-02-23 21:00:29 UTC
When trying to change a page visibility, a

is thrown.
Comment 1 Rui Marinho 2015-05-26 11:43:54 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. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there. 

Warm regards,
Xamarin Forms Team
Comment 2 João Vitor 2015-05-26 12:30:01 UTC
Created attachment 11336 [details]
Bug repdocution project.
Comment 3 João Vitor 2015-05-26 12:31:07 UTC
Clean Xamarin.Forms project (with updated nuget packages), with a single line added to the App constructor:

MainPage.IsVisible = false;


System.InvalidCastException: Unable to cast object of type 'Xamarin.Forms.ContentPage' to type 'Xamarin.Forms.View'.
  at Xamarin.Forms.VisualElement.<.cctor>b__3 (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00112] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x00235] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x00061] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.VisualElement.set_IsVisible (Boolean value) [0x00000] in <filename unknown>:0
  at TestPageVisibility.App..ctor () [0x00057] in /Users/joao/Projects/TestPageVisibility/TestPageVisibility/TestPageVisibility.cs:28
  at TestPageVisibility.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x0000c] in /Users/joao/Projects/TestPageVisibility/iOS/AppDelegate.cs:22
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/src/UIKit/UIApplication.cs:63
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/src/UIKit/UIApplication.cs:47
  at TestPageVisibility.iOS.Application.Main (System.String[] args) [0x00008] in /Users/joao/Projects/TestPageVisibility/iOS/Main.cs:17

=== Xamarin Studio ===

Version 5.9.1 (build 3)
Installation UUID: 0dca64e4-d900-4836-b697-c381adbe2408
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: (Indie Edition)
Hash: 3c4e832
Branch: master
Build date: 2015-05-20 21:47:57-0400

=== Xamarin.Android ===

Version: (Indie Edition)
Android SDK: /Users/joao/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f

=== Operating System ===

Mac OS X 10.10.3
Darwin Joaos-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 4 Rui Marinho 2015-05-26 13:04:08 UTC
Thanks i can confirm the issue.
Comment 5 Rui Marinho 2015-06-22 11:26:03 UTC
This is fixed in 1.4.3