Documentation: Master Detail Page Navigation
None of the samples listed on the website, nor any blog posts for that matter, detail how to implement drawer based navigation using ReactiveMasterDetailPage.
This is a significant setback to Xamarin Forms based development as drawer based navigation is the defacto standard for mobile applications.
Still need to add some documentation on the website but here's a sample project: https://github.com/reactiveui/ReactiveUI/pull/1741
I noticed the PR uses a Navigation Page for the detail Page. Doesn't this prevent viewmodel routing? I thought the whole idea was to use RoutedViewHost to route ViewModel first?
That NavigationPage is never actually used for routing at all. Just like in the official Xamarin example, it’s sole purpose is to display the navigation bar (for the title and hamburger button). So this example is still doing ViewModel-first routing.
I didn’t include it in this example because this is just a single page application (just the MasterDetail page), but if your application has multiple pages you would use the RoutedViewHost at the root level e.g. MainPage = new RoutedViewHost() in App.xaml.cs. Then you can utilize ReactiveUI’s routing system.
In the official Xamarin example
https://github.com/xamarin/xamarin-forms-samples/blob/master/Navigation/MasterDetailPage/MasterDetailPageNavigation/XAML/MainPage.xaml.cs
they create a new NavigationPage and a new content page every time a list item is selected but that seems like a waste to me. The example in the PR only creates one NavigationPage and one detail page and reuses them.
If you need an example of routing, let us know.
EDIT
On second thought, I’ll go ahead and add navigation to this example because it’s a simple addition.
On Wed, 5 Sep 2018 at 7:59 AM Andrew Hunter [email protected] wrote:
I noticed the PR https://github.com/reactiveui/ReactiveUI/pull/1741/commits/aab256ff6ef20cd13ef0cbb2183145f6291f9f23 uses a Navigation Page for the detail Page. Doesn't this prevent viewmodel routing? I thought the whole idea was to use RoutedViewHost to route ViewModel first?
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/reactiveui/website/issues/174#issuecomment-418544537, or mute the thread https://github.com/notifications/unsubscribe-auth/AGgOIk3-7cX1jNN7OWYO2t2zVwKDu76oks5uXwXXgaJpZM4WWWZt .
I have a routing example in the works. I'll make another PR when it's ready.
@AndrewPHunter Sorry for the delay. Here's the improved sample that includes navigation and supports various detail views. I think this is more what you were looking for. Let us know if this helps, and we'll get a guide put up on the website.
@glennawatson this can be closed now. The Master-detail example is listed on the Samples page now.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.