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