Navigation from modal not working in .net maui - maui

How do you navigate from a modal popup?
I've opened a modal page using await NavigationService.PushModalAsync() which I'm using as a login page. With a successful login, I'm trying to close the modal and navigate to an account page.
await NavigationService.PopModalAsync();
await NavigationService.PushAsync();
The modal closes, but it will not show the page specified in the PushAsync Method.
Both lines of code run, no errors thrown.
The page the pushasync() goes to, displays fine if the login modal window is skipped.
The above code is in a [RelayCommand] method using community toolkit mvvm
What do I need to do to get the above to work?

Unfortunately your needs cannot be achieved. As mentioned in the figure above, the login page you created is a modal page, therefore it can navigate only to another modal page. When you call PopModalAsync, the login page pops up from ModalStack directly, meanwhile the (moldeless) page at the top of the NavigationStack will appear. And you call PushAsync to navigate to the account page in modal page, it doesn't work.

Related

How to exit app with back button instead of just pop

I am building an app(Learning) and on first use the app it show authentication page with login and signup button if user click any one button and fill the fields it will be navigate to homePage.
Navigation :
Authentication Page=>login=>main page
Now the problem is I don't want users to get back to login page if they press back button on home page. Instead I want to exit the app.
How can I do it?
When you navigate from login to main page use Navigator method .pushReplacement() instead of .push() and that will replace the login page on Navigator stack. Which means that the main page will be the only one on the stack. Pressing the back button or calling method .pop(), in that case, will close the application.

Login gets lost with Navigation IE in Powershell aspx

I am trying to automate a website interaction.
I can login programatically without issue.
Once I login I get to a page with a toolbar. When I hover over one of the options of the toolbar, the bottom of the ie screen displays a url that ends with .aspx.
When I navigate using $ie.navigate
$ie.Navigate("https://dcr.alleghenycounty.us/Civil/Filing/InitialCaseFiling.aspx")
, it redirects me to a page that tells me I need to log in. When I click manually works properly. There is no element for the drop down that I click on.
I am concerned that the navigate function causes the page to lose some kind of cookie.
I tried invoke-webrequest but it didn't do anything in the browser.
I tried appending the 2048 tag in the navigate command to open in new window.
Is there an alternate method of opening an .aspx?
I need to use powershell. I need to use internet explorer.

popAndReplacement shows page which is behind the poping page in Flutter

There are 3 screens in my app. When I use popAndPushNamed() in the 2nd page, it pops the 2nd page and shows the 3rd page, but when It pops it shows the 1st page behind it in milliseconds. how to avoid that?
is Animation the way?
or are there any other methods just like push and show 3rd page, and pop 2nd page when the 3rd page visible to the user?
popAndPushNamed() as the documentation suggests, pushes the new route but pops the old route simultaneously, and hence, there is a small moment where you can see the first page even if your new routes are fully opaque. Replace the method with Navigator.of(context).pushReplacementNamed() and it should work as expected.

Paypal button Return Url target

I am embedding Paypal button into my app and, customizing it by following https://developer.paypal.com/docs/integration/direct/identity/button-js-builder/
The issue is, I want to close the popup window and refresh my main site with the Return URL, but actually the popup window is refreshed.
Question is how to close the popup window and refresh the main site.

IE issues with PayPal In-Context Express Checkout

I'm implementing PayPal's In-Context flow for Express Checkout as specified in the documentation. Everything works as expected in Firefox, Chrome, and Opera. IE, however, gives me some issues.
When I click the "Checkout with PayPal" image, the page goes dark and the modal window opens above it to PayPal's login/signup page as it should. But just before the page loads in the modal window, the page behind it turns white again, allowing users to interact with it which it shouldn't. I'm still able to go through with logging in and things in the modal window, yet the page behind it is active.
The second issue deals with redirecting. In IE, the modal window NEVER disappears after clicking the "Continue" button, which redirects to a specified url on my server. The redirect happens alright; it just doesn't happen in the main window as it should but instead happens in the modal window. Simply put, everything that occurs after pressing the "Continue" button happens in the modal window with no more interaction with the main window.
Again, everything works in other browsers (I've yet to test things in Safari), but IE (v.11) isn't behaving correctly. Can someone point me in the right direction?
Thanks
I too had similar issue with IE/Firefox when I was using custom button images.
To overcome I just had to remove the button variable and let the javasript generate its own button.
window.paypalCheckoutReady = function() {
paypal.checkout.setup('S4X5XW328WAYY', {
container: 'myContainer',
environment: 'sandbox'
// button: 'incontext_id'//commented
});
Demo and PHP sample code here