Bug 53143

Summary: Wrong assembly path, namespace and variable in MasterDetailPage template
Product: Visual Studio Extensions Reporter: Frankie Foo <frankiefoo732>
Component: TemplatesAssignee: Pierce Boggan [MSFT] <pierce.boggan>
Status: RESOLVED DUPLICATE    
Severity: normal CC: jas, joe, kzu, mono-bugs+bugzilla, pierce.boggan
Priority: ---    
Version: 4.3.0 (C9)   
Target Milestone: 15.2   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description Frankie Foo 2017-03-08 03:45:45 UTC
### Scenario

- Add MasterDetailPage to folder in Portable project.
- 4 files generated( HostPage.xaml, HostPageDetail.xaml, HostPageMaster.xaml, HostPageMenuItems.xaml)
### Issues

- HostPage.xaml: Incorrect XML namespace by including the folder name as part of the assembly path: xmlns:pages="clr-namespace:MyApp.Pages; assembly=MyApp.Pages"

- The generated class def in *.xaml is x:Class="MyApp.Pages.HostPage", but it mismatched with the code-behind *.xaml.cs, which the namespace is defaulted to "MyApp.Pages.HostPage"

- HostPageMaster.xaml.cs: a ViewModel is included but with a mismatched variable (MenuItems vs HostPageMenuItems)

class HostPageMasterViewModel : INotifyPropertyChanged
{
    public ObservableCollection<HostPageMenuItem> MenuItems { get; }
    public HostPageMasterViewModel()
    {
        HostPageMenuItems = new ObservableCollection<HostPageMenuItem>(new[]


Cross posted in https://forums.xamarin.com/discussion/90256/wrong-project-problematic-pages-template-issue-in-vs2017

### Steps

- Create X-Plat App > BlankApp + Forms + PCL
- Add new folders (Pages) to portable 
- Add 'Forms MasterDetailPage XAML' to the 'Pages' folder

### Version

VS 2017 Enterprise 15.0.0-RTW+26228.4
Xamarin 4.3.0.784
Comment 1 Pierce Boggan [MSFT] 2017-04-06 18:40:56 UTC
Thanks so much for the report, Frankie! :) We have fixed this bug in Visual Studio 15.2, and it should be included in the next preview of Visual Studio (and eventually 15.2 stable).

For instructions on installing preview builds, visit:
https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/#visualstudio2017

*** This bug has been marked as a duplicate of bug 53020 ***