Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PushModalPlainAsync() method #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MoralCode
Copy link

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.

@MoralCode
Copy link
Author

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

@codemillmatt
Copy link
Owner

This seems reasonable.

Out of curiousity - what’s the scenario where you’re showing a modal w/o the toolbar at the top?

@MoralCode
Copy link
Author

MoralCode commented Mar 28, 2018

@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.

@rasmuschristensen
Copy link

@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 :)

@MoralCode
Copy link
Author

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

@ewoody
Copy link

ewoody commented Dec 28, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants