codemill.vmfirstnav icon indicating copy to clipboard operation
codemill.vmfirstnav copied to clipboard

Add a PushModalPlainAsync() method

Open MoralCode opened this issue 7 years ago • 6 comments
trafficstars

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 avatar Mar 27 '18 02:03 MoralCode

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

MoralCode avatar Mar 27 '18 02:03 MoralCode

This seems reasonable.

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

codemillmatt avatar Mar 27 '18 23:03 codemillmatt

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

MoralCode avatar Mar 28 '18 22:03 MoralCode

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

rasmuschristensen avatar Mar 29 '18 07:03 rasmuschristensen

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

MoralCode avatar Mar 30 '18 01:03 MoralCode

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.

ewoody avatar Dec 28 '21 13:12 ewoody