Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Use MasterDetail page (Menu) and Navigation page in a project

$
0
0

Hello All,

I am developing XF app for iOS and Andorid. I need to use Menu in my project. I followed this article to use MasterDetail navigation page - https://www.syntaxismyui.com/xamarin-forms-masterdetail-page-navigation-recipe/. And it is working fine.

But now I need to use navigation page before using MasterDetails page. Let me explain with an example -

*** LoginPage.cs is a simple content page that will be shown when app starts. After successful login app will show Menu (using MasterDetail navigation page).

  1. In my App.cs file I have used
    MainPage = new LoginPage ();

  2. In LoginPage after successfully login, I am using the code to load Menu (MasterDetails page)
    Application.Current.MainPage = new RootPage () // RootPage is a subclass of MasterDetail page

But problem is - after showing Menu, app is crashing without not showing any message in application log. I investigated and debug and found that app is crashing due to "Application.Current.MainPage = new RootPage ()". Though this code should be work.

So, my question is what is the best practice to use MasterDetail page after using normal navigation page ( MainPage = new LoginPage (); ).

Any suggestion will be highly appreciable!

Thank you,
Arefin


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>