Bug 40358 - Issue with MasterDetail Page in UWP
Summary: Issue with MasterDetail Page in UWP
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows (show other bugs)
Version: 2.1.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-13 19:27 UTC by Anubhav Ranjan
Modified: 2016-05-06 19:43 UTC (History)
3 users (show)

Tags:
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:
Status:
RESOLVED INVALID

Description Anubhav Ranjan 2016-04-13 19:27:27 UTC
#Issue:
========
MasterDetailPage Navigation doesn't show the Hamburger menu after upgrading to Xamarin.Forms v2.1.0.6524

#Description:
==============
With Xamarin.Forms v2.0.1.6505, our master detail view looked like this
(note the hamburger menu and the title 'Menu' at the top)

With the latest update (XF v2.1.0.6524), the hamburger menu is no longer
visible, and there is a block of blue at the bottom - it looks like the
whole master section has shifted up and is hiding the hamburger menu.


Screenshots:
=============
Correct Output:
---------------
2.1.0.6505: https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/320136/2.0.1.6505.PNG

Incorrect Output:
-----------------
2.1.0.6524: https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/320136/2.1.0.6524.PNG

2.2.0.5-pre: https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/320136/2.2.0.5-pre.PNG


Sample:
========
https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/320136/Itron.zip


Version Info:
==============
Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA004
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA004
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA004
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA004
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA004
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   4.3.60226.3
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper Ultimate 10.0.2   Build 104.0.20151218.120627
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript   1.7.6.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.0.3.214 (0dd817c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.3.5 (a94a03b)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.6.1.8 (3a25bf1)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Samantha Houts [MSFT] 2016-04-20 18:21:38 UTC
Please change your NavigateTo method to:

public async void NavigateTo(ContentPage page)
{
    await Navigation.PushAsync(new NavigationPage(page));
}

The hamburger menu will only appear with a NavigationPage. This is not a regression because the previous behavior was unexpected.

Thank you!
Comment 2 wayne.creasey 2016-04-20 20:10:25 UTC
The NavigateTo method is actually not used in that sample. I did, however, change the MainView constructor to use a NavigationPage:
     this.Detail = new NavigationPage(newDetailPage);
but there is still no hamburger menu. Please advise.
Comment 3 Samantha Houts [MSFT] 2016-05-03 22:41:54 UTC
Oh, apologies! I see what you mean now. This is also by design--on the desktop/tablet, we default the MasterBehavior to Split. This negates the need for the hamburger icon altogether because the Master is always visible. That's the block you see on the left side there.

You may change this by changing the MasterBehavior property. For example, MasterBehavior.Popover will display the hamburger icon and hide the Master view until you click the icon again.
Comment 4 wayne.creasey 2016-05-06 19:43:03 UTC
OK. so I think we can work with that. However, there still seems to be a layout issue. If you change the MainView.xaml to include a stacklayout set to FillAndExpand (and a different background color so you can see the problem), it appears that the stacklayout is shifted up, leaving a blue bar (looks about the same height as the hamburger menu/panel) at the bottom. In my case, I think the desired effect is that the background of the label would be blue, and the rest of the vertical space would be yellow

Here is the modified XAML:
<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ItronMasterDetail.Views.MainView" MasterBehavior="Popover">
  <MasterDetailPage.Master>
    <ContentPage Icon="slideout.png" Title="Menu" BackgroundColor="#03415F">
      <StackLayout>
        <Label Text="Dummy Label"></Label>
        <StackLayout BackgroundColor="Yellow" VerticalOptions="FillAndExpand">
        </StackLayout>
      </StackLayout>
    </ContentPage>
  </MasterDetailPage.Master>
</MasterDetailPage>

I'd be happy to attach/send a screen shot if that helps.