codemill.vmfirstnav
codemill.vmfirstnav copied to clipboard
Add a PushModalPlainAsync() method
I noticed that the existing PushModalAsync() method wraps everything in a NavigationPage which may not be desired behavior in some cases. So I added this method to the NavigationService.cs file to allow developers to push a modal as-is. This is just a super-quick fix and there is probably a better way to implement this kind of flexibility.
might be good to apply something similar to line 77 of this same file too since thats another place where it wraps the page in a NavigationPage
This seems reasonable.
Out of curiousity - what’s the scenario where you’re showing a modal w/o the toolbar at the top?
@codemillmatt im trying to display a login page as modal on top of a MasterDetailPage (so the user can't swipe to access the menu and navigate away from the login page.
However, I did find a better solution that sorta makes this modification unnecessary. By putting NavigationPage.SetHasNavigationBar(this, false); in the constructor of the code-behind of the LoginPage that I was trying to display, it doesn't display the Nav Bar.
@DeveloperACE What is your workflow. Do you start with a login prompt og is it to unlock some features? You might be able to make it more simple just by changing navigation. start by having the loginpage and if user login successfully then have navigate to your main parts of the app with the master detail where you replace the root navigation.
Of course it depends of what you are trying to build :)
The intention is to start with a login prompt to get user credentials to access the API that contains all the data needed for the rest of the app.
I’m looking into other libraries like mvvmcross that do similar things to this library but I’m pretty new to Xamarin and C# so I’m just kinda learning as I go and hoping I’m doing it right
We can't change navigation bar background color, text color and text font because that PushModalAsync() method wraps everything in a NavigationPage. We do have a customrized Navigtion page for navation pages but we can't apply it in modal page.