Bug 53141 - [Cycle 9] New "Master Detail" Xamarin.Forms template project confusingly does not use the `MasterDetailPage` class at all
Summary: [Cycle 9] New "Master Detail" Xamarin.Forms template project confusingly does...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Templates ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: Low minor
Target Milestone: 15.4
Assignee: Joaquin Jares
Depends on:
Reported: 2017-03-08 03:34 UTC by Frankie Foo
Modified: 2017-06-22 18:31 UTC (History)
7 users (show)

Tags: Cycle9R
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 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 Frankie Foo 2017-03-08 03:34:50 UTC
### Steps

1. Create New Project > Cross Platform App > Master-Details+ Xamarin Forms + PCL

### Version

VS 2017 Enterprise 15.0.0-RTW+26228.4
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-08 04:27:51 UTC
## Bookkeeping note

I will prepare a non-engineering team preliminary quick review for this report.
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-08 04:51:34 UTC
Non-engineering team preliminary quick review
(See https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/howto-file-bug/ for general reference.)

## Suspected to be a regression or a problem with a new feature?

This seems to be an issue with the new Cross Platform project templates wizard feature.  Some additional questions that might make sense to check on quickly would be:

- Whether the templates are different when using Xamarin Cycle 9 in VS 2015 as compared to VS 2017?

- Whether the Xamarin Studio Xamarin.Forms templates on Mac have a similar issue?

- How the Xamarin.Forms templates in Xamarin Cycle 8 in VS 2015 compare?

## Includes clear steps to reproduce the problem?

Very nearly.  I can fill in one missing piece about _where_ "TabbedPage" is coming up:

### Actual behavior

The `SetMainPage()` function in App.xaml.cs in the portable library project sets `Current.MainPage = new TabbedPage()`.

No file in the project contains the word "MasterDetailPage".

### Expected behavior

Note that:

(a) The project type is named "Master Detail" in the wizard.

(b) Xamarin.Forms includes a page type named "MasterDetailPage" [1].

Given these considerations, a user would reasonably expect the generated "Master Detail" project to make use of the "MasterDetailPage" class, quite possibly as the "MainPage".

[1] https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/navigation/master-detail-page/

## Already took up time for many users?

Not yet.  So far there the reporter is the only user on CC on this bug report, and there aren't yet any other matching reports in Bugzilla.

## Makes development (a) difficult, impossible, or potentially hazardous, (b) moderately inconvenient, or (c) mildly inconvenient for users?

(c) This result is potentially confusing, but depending on the app design the user is aiming for, it's not necessarily inconvenient.  In my very quick preliminary sanity-check, the expanded template does build and run successfully on iOS simulator, and the app does render a "master" list view of items that can be tapped to view the "details" about each item.
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-08 05:10:30 UTC
## Are the templates different when using Xamarin Cycle 9 in VS 2015 as compared to VS 2017?

No.  I created a project using the "Master Detail" template in VS 2015 and another project in VS 2017.  I used the same project name for both.  I then diff'd the contents of the two resulting solution folders.  No .xaml or .cs files contained any differences.  The project in Visual Studio 2015 is just like the project in VS 2017: the "Master Detail" template uses a `TabbedPage` for the "MainPage", and no file in the project contains the string "MasterDetailPage".

I am accordingly updating the bug title to reflect the fact that this is an issue with a new feature in Xamarin 4.3 Cycle 9 that affects _all_ versions of Visual Studio.

## Do the Xamarin Studio Xamarin.Forms templates on Mac have a similar issue?

Not applicable.  As of the current Cycle 9 Stable channel versions, the Xamarin.Forms templates on Mac don't have any option to create a "Master Detail" project.

## How do the Xamarin.Forms templates in Xamarin Cycle 8 in VS 2015 compare?

As with Xamarin Studio on Mac, the Xamarin 4.2 Cycle 8 Xamarin.Forms templates in Visual Studio do not include any "Master Detail" option.

So this issue does indeed seem to be an oddity of the newly introduced template named "Master Detail".  Perhaps the simplest way to correct the expectations about behavior would be to change the string "Master Detail" in the template wizard to some other phrase to avoid the name conflict with the built-in `MasterDetailPage` class in Xamarin.Forms.
Comment 5 Joaquin Jares 2017-06-22 12:22:10 UTC
Master Detail templates no longer have a MasterDetailPage. They now have an AboutPage, ItemsPage, ItemDetailPage and NewItemPage. They are all used. I'm resolving this issue as fixed.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-22 15:59:42 UTC
That is the opposite of what this bug is discussing.  This bug is discussing the fact that a template named "Master Detail" page _should_ use `MasterDetailPage` or _not be called_ "Master Detail" template (or in some other way explain to users _why_ it doesn't use the `MasterDetailPage` class).  Reopening.
Comment 7 Joaquin Jares 2017-06-22 16:33:13 UTC
I see what you mean. The template is MasterDetail because that's the design idiom it uses. There's a Master page (Items) and a detail page (ItemDetail). I don't think MasterDetail is a good name for the Items page. Items is way more accurate to what the page is. The template looks like that by design.
Comment 8 Pierce Boggan [MSFT] 2017-06-22 18:31:10 UTC
Thanks so much for taking the time to report this, Frankie! :) Things that are confusing as part of File -> New or first run are certainly very important to raise.

The "Master Detail" cross-platform template can certainly be interpreted as a misnomer, as I've described in the Xamarin Forums:

In (potentially) 15.4 but definitely before 15.5 we will be breaking this template off into three sub templates that are better named:

- List View: a list of data with a detail page that appears when an item is clicked.
- Tabbed: the current master detail template, or the ListView template above with tabs.
- Flyout: the List View template above, using the flyout navigation scheme (in Xamarin.Forms, this would be using a MasterDetailPage).

Using names like this that are more clear across native Xamarin and Xamarin.Forms will hopefully help avoid confusions like this.