White Screen Issue while navigating in Xamarin forms Prism MasterDetails Page - xamarin

I have implemented MasterDetail Page using xamarin forms prism and I have following Pages in my app.
1) Master
2) Home
3) Employee
4) Profile
-- Initially App is set to Master - Home (Detail Page) page after login. From Home page i navigate to Employee (Detail Page) using code as follows :
await _navigationService.NavigateAsync("NavigationPage/Employee");
-- From Employee Page I navigate to Profile (Content Page - Non Detail page) by clicking on one of the employees using code:
await _navigationService.NavigateAsync("Profile", lstparam, null, false);
-- Once home button is clicked in profile page, i want to navigate to Master - Home (Detail Page) . However it navigates to Employee (Detail Page) .
await _navigationService.GoBackToRootAsync();
Checked navigation stack by debugging , It was only showing Employee (Detail Page) Page in it. Also tried navigation to home page by using following code :
await NavigationService.NavigateAsync("/Master/NavigationPage/Home");
The above code is working and i can navigate to Home (Detail Page) , but I am getting White Screen while navigating to Profile to Home Page .
Attached Screenshots . Please Help .Thanks in Advance.
MasterPage
Details_Home
Details_Employee
Profile
Whitescreen

I recently had a very similar problem but it did not depend on prism.
I wanted to create an autologin features by bypassing the login (ContentPage) and calling the homepage (Master And Detail Page).
To do this I had to call the async login service method in my application class.
in order:
Call async service
Call NavigationService.NavigateAsync
In this case appears a blank page
To Solve:
Call NavigationService.NavigateAsync
Call async service

In my case, it happened to me for being using the wrong NavigationService.
I had a static Navigator class that I've been using it for managing and Logging navigations in the App (a simple wrapper), which has a property called Instance, of type NavigationService that I was setting it to the NavigationService of the App.xaml.cs
Reassigning it on each ViewModel (in the ViewModelBase's constructor) fixed the white page bug for me.
Hope it helps someone!

Related

How add a back button manually in NavigationPage?

I have a login page in Xamarin.Forms without NavigationPage, but I have a button in this page to navigate to other page to create a new user and, in the page of insert user, I need add a back button to allow users go back to the login page.
How can I do that?
ps: I'm using Prism framework.
My code to open login page:
await NavigationService.NavigateAsync("Login", parametrosNavegacao);
My code to navigate to page that register user:
await NavigationService.NavigateAsync("NavigationPage/CadastroUsuario", useModalNavigation: true);
NavigationService.PopupGoBackAsync();
https://github.com/dansiegel/Prism.Plugin.Popups
One option can be
NavigationService.NavigateAsync("/Login");
the / bebore Login means Absolute url, and prism clears navigation stack, other wise clicking android's back button will again open up insert user page.

xamarin navigation - how to normally implement navigation between login and masterdetailpage

So, how do you normally implement navigation between login page and masterdetailpage.?
I tried few implementation and not really what I am looking for.
So basically, when the login is successful, themasterdetailpage should be the root navigation so if we go back /or pop, we would need to go out of the app. But at the moment, it goes back to the login page.
I tried..
using NavigationPage and InsertPageBefore the mainpage and pop so it is in the root page, but there is a catch because of the navigation tab showing on both loginpage and masterdetailpage (one tab layer for navigationpage and one extra layer of tab for master page in masterdetailpage)
I tried..
just instantiating the App.MainPage as new loginPage() without wrapping in NavigationPage, but I could not find a way to open masterdetailpage
Any help and direction is appreciated cheers,
You have not to add LoginPage to Navigation.
You should
Application.Current.MainPage = new LoginPage();
after login is ok you should
Application.Current.MainPage = new MyMasterDetailPage();

Master Detail Page Xamarin Forms

Aright, let me try to make it a bit simple,
When i Login: i set the my root page as a Normal ContentPage,
var firstPage = new BaseNavigationPage(new DashBoardPage());
(DashBoardPage is just a contentPage, with few buttons)
On click of the buttons, i navigate my app, using
NavigationService.NavigateTo(ViewModelLocator.CommentPage);
Now on DashbOard, there is button, which redirects me to a Page which is a MasterDetailPage, so using some custom thing,
i navigate by setting my MasterPage,
NavigationService.SetMainPage(ViewModelLocator.MASTER_PAGE);
Following is my MasterDeatilPAge Code;
var menuPage = new MenuListPage();
Master = menuPage;
Detail = new CustomNavigationPage(new WorkTaskPage());
Now , on the Menu Page, i have an List Item as DashBoard, and i have to redirect my App to the first Page,
So how can i do that, since with MasterDetail Page, i can either Navigate Detail Page or Set the Detail Page,
So how can i redirect it to the Dashboard Page, and i want all navigation to work normally when i am on dashboard page, without changing any navigations.
Hope this is a bit clear?

how to know the base page user is navigated from to a new page in windows phone

In my windows phone application I want to know from which page user is navigated to a new page.I want to get the name of the from page from which user navigated to this new page ?
Any property which gives us this ?
You can use NavigationService.BackStack to traverse the current Navigation Stack and figure out where you came from: http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationservice.backstack(v=vs.92).aspx

ScriptManager error while loading a page

I just put an ASP:scriptmanager within my login page and for the use of a tag cloud. And after login providing uname and pword redirect to home page.
My home page consists of a master page and I put an ASP:scriptmanager within the master file. But when the home page loads, the following error appears:
"The control with ID
'AutoCompleteExtender1' requires a
ScriptManager on the page. The
ScriptManager must appear before any
controls that need it. "
My home page has several controls used with Ajax.
Can any one help me?
first thing you should test wethere you have created an script manager or not
test it by viewing the page source in html if there is any entry not speciting the scriptmanger then its seems that your page is not have any scripmanger on the parent page or the child page.

Resources