question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Master and Detail must be set before adding MasterDetailPage to a container

See original GitHub issue

We have made no changes to our code but updating the newest (stable) Xamarin.Forms v2.1.0.6529 and FreshMVVM (1.0.3.003) we are now receiving this error:

Master and Detail must be set before adding MasterDetailPage to a container

I can confirm that Detail is not being set as the resolver can’t find the PageModels.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

8reactions
Xamtasticcommented, May 4, 2016

I had a similar problem on another project and it all resolved itself by adding a Title to the Master ContentPage, vis-a-vis:

  <MasterDetailPage.Master>
    <ContentPage Title="My Title" />
  </MasterDetailPage.Master>
  <MasterDetailPage.Detail>
    <NavigationPage>
      <x:Arguments>
        <ContentPage />
      </x:Arguments>
    </NavigationPage>
  </MasterDetailPage.Detail>
2reactions
eseo-dasacommented, Jul 10, 2016

Hi ! I solved the problem because the Content Page need to have a title :

<MasterDetailPage.Detail>

<NavigationPage>
  <x:Arguments>
    <ContentPage Title="This is a view"></ContentPage>
  </x:Arguments>
</NavigationPage>

</MasterDetailPage.Detail>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin - Master and Detail must be set before adding ...
I am assuming that it is to do with autofac that is being used in the application as an IOC container but havent...
Read more >
Master and Detail must be set before adding ...
I am getting below error when I am navigating from first page to second page. Master and Detail must be set before adding...
Read more >
Xamarin.Forms FlyoutPage
The Xamarin.Forms FlyoutPage is a page that manages two related pages of information – a flyout page that presents items, and a detail...
Read more >
Working with Master-Detail-Pages
The MasterDetailPage is a very special type of page in Xamarin. ... Forms has a requirement that your Master page MUST contain a...
Read more >
Master and Detail must be set before adding ...
InvalidOperationException: Master and Detail must be set before adding MasterDetailPage to a container Obs.: Estou chamando.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found