Mvvmcross: MvxMasterDetailPage is not working in Forms on version 5.4.x

Created on 17 Nov 2017  路  10Comments  路  Source: MvvmCross/MvvmCross

I tried to configure MasterDetailPage on my new project (Xamarin.Forms) following the testproject/playground steps, but at the end it's just showing a blank screen.
TestProject in this repo: https://github.com/MvvmCross/MvvmCross/tree/develop/TestProjects/Playground
After downloading the full MvvmCross repo and running the TestProject and clicking the button "Show Master/Detail" the result is same (blank screen).

What could be the problem?
Found another post with same problem: http://danlec.com/st4k#questions/47151849
Attached the ios simulator screen from the issue:
simulator screen shot - iphone 8 - 2017-11-17 at 00 44 29

invalid needs-more-info

All 10 comments

The MasterDetail implementation to Forms is just completely broken (and it always was since it exists). I would recommand to use some other navigation method because I don't think it gets fixed soon. The white page will not be your only problem with this. If you just want your root page displayed trigger the navigation in the ViewModel for your default page.

But than you will get these three problems:

  1. Every navigation from the master is pushed to the navigation stack. This would be no problem if NavigationMode with ClearStack would clear the stack but it does not. So if you trigger 3 navigations and close the master menu, you need to use the "Back"-Button at the top left until you can open your master page again. This is not a behaviour of a master detail page and in my case it is a absolute deal breaker because you need way to much time to built around this.

  2. The master menu is not closed after the navigation is triggered. There is a way to create a workaround but for me it does not work either.

  3. If you are using SplitView (iOS 9+) on an iPad and reduce the size of your app, the master is always displayed. This is a bug of Xamarin.Forms itself and the developer of Xamarin.Forms just ignored this issue (it is already reported 9 times in their bug tracker from different developers and the first report is from late 2015). The only work around gets killed with the 2.4 update of Xamarin.Forms and guess what, they ignored the report of this too...

When it comes to Xamarin.Forms it is mostly stable (iPhone X support, SplitView and some other stuff is totaly broken but yea...). But when it comes to MVX with Forms I would not think about a production release in the next few months. Every update kills stuff you are working with and even outdated methods are not flagged as Obsolete - they just stop working if you upgrade. Also so many parts are still broken, not working or just very odd (like the MasterDetail page stuff). It's fun to play with but it is not for production, at least not yet.

  1. The NoHistory = true parameter should work correctly from 5.4.2, at least it does in my apps and the playground sample.

  2. In just plain Xamarin.Forms you also need to close it yourself. This works for me.

Other then this, we are currently working very actively to solve any Forms issue's. This also means we are in the process of stabilizing our API for it, and that it might break sometimes. I've seen several apps in production and in development with this already so i don't think this is a big problem. The larger problem is just that the learning curve is a bit high at the moment, and we need to update the documentation to improve that. We would be happy to receive contributions for that!

  1. If I use the NoHistory it works with 5.4.2 - was not expecting this after all the issues. But therefore the MasterMenu Icon is disappearing when navigating...

  2. I guess I marked the wrong part in my code as "Not working". The IsPresented = false is working, the IsGestureEnabled = false is not. And this still breaks my whole app for me because I have a map in it and I cannot scroll in this map because the master menu is triggered over and over again. But I guess it is more a problem of my application design. I do not spent much time on it yet because other things are not working as well.

  3. The default page is not loading (as @suranyig already mentioned) is still an issue.

  4. Also MVX faces the same issue as Xamarin.Forms MasterDetail page (SplitView on iOS 9+ is not working, menu is always visible when width is 50% or less - sadly Xamarin is ignoring this issue as well because it was reported in 2015 and is still there...).

I really love the way this framework goes and I think it is the best option for a Xamarin native app. But because of regular breaking stuff and some parts not working, it is really risky to use it for production yet. Just my opinion.

Can you check this again in 5.5?

Is there some sort of documentation how MasterDetail should work with 5.5? Because now my entire app stays white and not even the NavigationPage with the Menu-Icon is loading.

This is the log I get:

iOSNavigation:Diagnostic:  0.53 Navigate requested
mvx:Diagnostic:  0.83 Adding subscription 93c66b8c-1c56-4668-a7b8-9ae92500cf10 for AppEvent
mvx:Diagnostic:  0.83 Nothing registered for messages of type MvxSubscriberChangeMessage
mvx:Diagnostic:  0.89 No view model association found for candidate view MvxMasterDetailPage
mvx:Diagnostic:  0.89 No view model association found for candidate view MvxMasterDetailPage
mvx:Diagnostic:  0.89 No ViewModel class specified for MvxMasterDetailPage in LoadViewModel
mvx:Warning:  0.89 ViewModel not loaded for view MvxMasterDetailPage
mvx:Diagnostic:  0.90 No view model association found for candidate view MvxContentPage
mvx:Diagnostic:  0.90 No view model association found for candidate view MvxContentPage
mvx:Diagnostic:  0.91 No ViewModel class specified for MvxContentPage in LoadViewModel
mvx:Warning:  0.91 ViewModel not loaded for view MvxContentPage

But there is no page with the name "MvxMasterDetailPage" or "MvxContentPage" in my project (okay, MvxContentPage is the type of all of my pages). Also there is no "LoadViewModel" in my project.

I'm not exactly sure where that comes from either. I'll have a look tomorrow if you can describe what sort of view structure your app has so I can reproduce it. A PR would be even better. Did you also look at the playground sample?

Great! Thank you @martijn00 :) The XF MasterDetail sample is working perfectly in Playground project (5.5.0 version). Checked on Droid (api level 22) and iOS (SE v11.1)

I just double checked with the Playground Sample and a friend of mine check it as well. But we were not able to found any difference that should effect this. I will try to locate the issue a bit more, but I guess I had todo it tomorrow (it's already pretty late here and the alarm for work goes off in 6 hours already).

@Sebastian1989101 Do you have a reproduction repo? I am available on XamarinChat Slack to see if we can work it out.

Fixed the issue of my repository. Sometimes it is helpful if a external person looks at it. I'm a bit ashamed of me what I missed, but I already sent it to martijn00 via Twitter.

Was this page helpful?
0 / 5 - 0 ratings