Bug 26309 - Xamarin.Forms 1.3.1 Setting MasterDetailPage.IsPresented=false doesn't work
Summary: Xamarin.Forms 1.3.1 Setting MasterDetailPage.IsPresented=false doesn't work
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-22 17:39 UTC by cdetera@computronsoftware.com
Modified: 2015-02-13 18:41 UTC (History)
4 users (show)

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

Sample Project to Replicated the Issue (4.27 MB, application/x-zip-compressed)
2015-01-22 17:39 UTC, cdetera@computronsoftware.com

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 cdetera@computronsoftware.com 2015-01-22 17:39:38 UTC
Created attachment 9454 [details]
Sample Project to Replicated the Issue

I have a MasterDetailPage application where I am showing and hiding (in Portrait mode) the MasterPage on click/tap of a button.  This functionality works fine in both Android and iOS until I upgraded my application to Xamarin.Forms 1.3.1.  Note that in Android it is working fine still but in iOS hiding the MasterPage (MasterDetailPage.IsPresented = false) doesn't work anymore.  Also note that in iOS

I have attached a sample project (FormsGallery.zip) to replicate the issue.  Once loaded in XS or VS, please follow the steps below to replicate the issue:
1. Run the application in iOS.  Make sure that the device/simulator is in Portrait mode/orientation.
2. In the Master Page click/tap on the Hide Master button on top of the page.  Note that nothing happens.  This is the issue.
3. Click/tap on the Detail Page (the Master Page disappears). Click/tap the Show Master button on top of the Detail Page (the Master Page displays).

On step 2 above, the Hide Master button sends a message (using the MessagingCenter) to the MasterDetailPage to set its IsPresented property to false.  Although the property got set correctly, it did not do what it is suppose to do - hide that Master Page.  However on step 3 above, the same approach was taken only that the IsPresented property is set to true (display the Master Page) it actually works.

My observation is that in iOS you can only programmatically show the Master Page (IsPresented = true) but you cannot hide (IsPresented = false) it.  No, there was no exception encountered in the code and inspecting the IsPresented, it is being set correctly.

As I mentioned, I never had this problem before 1.3 so I am very surprised to see in the Xamarin.Forms 1.3 release notes the item saying:

"IsPresented is now respected correctly when using MasterDetailPage. May throw exception now if IsPresented is set to a disallowed value with MasterBehavior."

Maybe the above fix actually broke what was working already.

Lastly and again, please note that this works fine in Android... same PCL code.

Comment 2 cdetera@computronsoftware.com 2015-01-23 10:21:39 UTC
Looks like our version numbers are off.  Note that I am on the Stable Channel and no updates are available.  Here's my MacBook Pro's Xamarin Studio info (also my build server when I am coding in VS):

=========== START ================

=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: c0aee4bd-dce6-4aa2-809e-871476fa138c
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/Carlo/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
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)

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: dfb682f
Build date: 2015-01-08 13:39:32-0500

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.1
Darwin CARLOS-IMAC.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

=========== END ================

Notice the Xamarin.iOS version and the XCode version???  Also, in case you need my Xamarin version info in VS here it is:

=========== START ================
Xamarin (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

=========== END ================

You seem to have followed the steps but your version of the Xamarin.iOS doesn't match mine (on Stable Channel).  Your XCode version is however a major version far back.
Comment 3 cdetera@computronsoftware.com 2015-01-23 12:36:18 UTC
You may want to retry replicating the issue with the latest XCode and latest Stable Xamarin release. Thanks!
Comment 4 cdetera@computronsoftware.com 2015-01-23 13:22:57 UTC
Related to XCode... please use iPad Retina 8.1 as your simulator once you have your XCode updated to the latest version - 6.1.1. Thanks!
Comment 5 cdetera@computronsoftware.com 2015-01-30 16:02:27 UTC
Just following up on this.  Were you able to replicate the issue?  Please note of the previous additional info.  Thanks!
Comment 6 Jason Smith [MSFT] 2015-02-13 18:02:24 UTC
Should be fixed on 1.3.4
Comment 7 cdetera@computronsoftware.com 2015-02-13 18:41:34 UTC