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

Navigation from Viewmodel

$
0
0

I have done Binding view and viewmodel. View is Loginpage.xaml and viewmodel is LoginViewModel
if my login response is Success,I want to insert my mainpage.xaml before loginpage.xaml and pop my loginpage.xaml
I have done this but I got an exception .how to solve this ?
or is there any otherway i could do this.

if (response.IsSuccessStatusCode)
{

            Application.Current.MainPage.Navigation.InsertPageBefore(new MainPage(), new LoginPage());
            await Application.Current.MainPage.Navigation.PopAsync();
        }

Unhandled Exception:

System.ArgumentException: before must be a child of the NavigationPage
Parameter name: before occurred


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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