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

Changing MainPage for an Application

$
0
0

Just upgraded to the latestest Xamarin iOS build (9.0.1.0) and I am now getting an error whenever I try to update the MainPage property of the application class. This is what my logic looks like:
1. User starts app and isn't auththenticated so MainPage is set to the login form.
MainPage = new LoginView();
2.

  1. When a user selects a menu item the MainPage is updated to the proper page.
    var page = (Page)Activator.CreateInstance(mi.ViewType);
    MainPage = new MasterDetailPage()
    {
    Master = new DrawerContentView() { Title = "Menu" },
    Detail = new NavigationPage(page) { BarBackgroundColor = Constants.HeaderBackground, BarTextColor = Color.White },
    IsPresented = false,
    IsGestureEnabled = false,
    };

This approach was working fine until I upgraded to the latest build and still works in Android I only get the error in iOS.
The error I get is:
System.ArgumentNullException: Argument cannot be null.
Parameter name: source

Any thoughts? Should I be taking a different approach?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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