Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Autofac Library Master Detail crash with Invalid Cast Exception

$
0
0

I am using Autofac and able to navigate with viewmodel based approach for initial screens.
At certain point say (Login), I need to show master detail screen. I have added below code to reset MainPage

Application.Current.MainPage = _viewFactory.Resolve ();

In the RootPage (which MasterDetailPage), I am setting menu and detail pages like below

Master = viewFactory.Resolve ();
MenuPage page = (MenuPage)Master;
Detail = new NavigationPage (viewFactory.Resolve());

I was able to show page but couldn't able to access _navigation or _dialogue services. Also not sure how I am going to drill down in each detail page.

If I access _navigation or _dialogue then app crashing with InValidCastException.

Please help me regarding whether I am following properly with switching from VM based approach to MasterDetail.

Thank you.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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