Bug 57854 - Layout problems with MasterDetail View in UWP which has a navigationpage as the parent
Summary: Layout problems with MasterDetail View in UWP which has a navigationpage as t...
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.5
Hardware: All Windows
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
Depends on:
Reported: 2017-06-29 02:24 UTC by Mark Radcliffe
Modified: 2017-07-18 18:39 UTC (History)
2 users (show)

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

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 Mark Radcliffe 2017-06-29 02:24:10 UTC
When a masterdetail's parent is a navigation page instead of its child an extra bar appears at the top of the page.

i.e the app has a navigation page, a masterdetail is pushed in the stack and now the extra bar is above the master detail.

However when the navigation page is the detail of the the master detail the navigation bar merges with the master details bar.
Comment 1 Jimmy [MSFT] 2017-06-29 18:48:20 UTC
Hey Mark, we do recommend that a NavigationPage only contain instances of ContentPage[1] and that a MasterDetailPage be the root page of an app, otherwise you may run into issues like this. 

In this case, you could use SetHasNavigationBar(mdPage, false) to hide the original nav bar. Alternatively you can also save the navigation stack, replace the root page with the MasterDetailPage, then restore the stack when needed. Hope this helps!

[1] https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/navigation/hierarchical/#Performing_Navigation
Comment 2 Mark Radcliffe 2017-06-29 20:40:40 UTC
Hi Jimmy, 

For the other two platforms this is not an issue, so this is a split in the way things work between UWP and iOS/Android. For a platform abstraction that is is a bug.

I shouldn't have to do such a drastic work around for working functionality on other platforms otherwise xamarin might as well stop saying they support UWP as they clearly don't support it well enough. I am constantly having to fix renderers and make hacks to make UWP work..

I cannot hide the extra bar as I need it for the toolbaritems that would normally show up in the same bar as the master detail. I just need the tool bar items to show up and for the colors etc to be respected on the bar like in android and iOS. When the nav page is in the master detail this works fine.

Saying the a master detail should always have a nav inside it rather than the otherway around is cutting out 50% of possible ways of using it..
Comment 3 Jimmy [MSFT] 2017-07-18 18:39:17 UTC
Hi Mark, 
I discussed this with the team and the MasterDetailPage was designed to only be used as a root page. Even though your use case is working on iOS and Android, this is unintentional and there are no plans to support MDP in non-root page scenarios. Thanks!