Comments (7)
For me even "../NewPage" does not work. I want existing page to be removed from the stack, and new NewPage is pushed to the stack.
NavigationService simply ignores all 'remove from the stack' requests and just pushes a new NewPage on top of the current stack.
from prism.
For me even "../NewPage" does not work. I want existing page to be removed from the stack, and new NewPage is pushed to the stack.
NavigationService simply ignores all 'remove from the stack' requests and just pushes a new NewPage on top of the current stack.
In my repro that seems to work. Can you verify that?
from prism.
For me even "../NewPage" does not work. I want existing page to be removed from the stack, and new NewPage is pushed to the stack.
NavigationService simply ignores all 'remove from the stack' requests and just pushes a new NewPage on top of the current stack.In my repro that seems to work. Can you verify that?
Yes it works on your repro. I guess my situation is different since I have a complex page construction.
1 - FlyoutPage/NavigationPage/TabbedPage (tabs generated dynamically using KnownNavigationParameters.CreateTab)
2 - One of the tabs inside TabbedPage navigates to PageA
3 - Then PageA goes to PageB by (../PageB).
What works in Xamarin is on PageB go back takes me directly to TabbedPage. In MAUI we go back to PageA, which should've been removed from the stack on step 3.
from prism.
For me even "../NewPage" does not work. I want existing page to be removed from the stack, and new NewPage is pushed to the stack.
You should take into consideration that if your root is not NavigationPage
then you don't have navigation stack. To have an ability do ../PageB when you have root PageA, your PageA should be the root of NavigationPage. In other words, you should have NavigationPage/PageA if you want to do ../PageB
Also you need to remember, that by the logic your NavigationPage cannot be empty (when it does not have root page). Because it does not have any sense in such implementation. And whenever you need an empty NavigationPage you have to think about your architecture and may be smth wrong with it
from prism.
For me even "../NewPage" does not work. I want existing page to be removed from the stack, and new NewPage is pushed to the stack.
You should take into consideration that if your root is not
NavigationPage
then you don't have navigation stack. To have an ability do ../PageB when you have root PageA, your PageA should be the root of NavigationPage. In other words, you should have NavigationPage/PageA if you want to do ../PageBAlso you need to remember, that by the logic your NavigationPage cannot be empty (when it does not have root page). Because it does not have any sense in such implementation. And whenever you need an empty NavigationPage you have to think about your architecture and may be smth wrong with it
My navigation stack is inside the Flyout's content. So there is a stack, even though the app does not start with NavigationPage, but instead starts with FlyoutPage/NavigationPage.
This exact code used to work with Prism.Forms btw. This is a %100 migration work. This clearly shows that something changed in PageNavigationService and uri parser that it ignores this remove instruction segment.
I haven't find time to debug myself yet tough unfortunately. I'll check myself when I do.
from prism.
I debugged this issue and think I found the issue.
The navigation won't work because NavigateAsync and GoBackAsync consume a request in the SemaphoreSlim and therefore the GoBackAsnyc won't finish if the navigation tries to remove pages and go back.
As far as I understand the GoBackAsync doesn't need to wait for the Semaphore in this context. Can we split the GoBackAsync in two separate methods? The GoBackAsync will wait for the Semaphore and call the GoBackInternalAsync. GoBackInternalAsync processes the navigation. The RemoveAndGoBack could call the GoBackInternalAsync and the issue should be resolved and it's ensured that only one navigation is done simultaneously.
I could create a PR for this if I get some feedback from @dansiegel or @brianlagunas
@bkaankose couldn't repro your case. I created the Tab with the NavigationBuilder and the ../PageB worked properly.
from prism.
@lucacivale thanks for stepping up to help out. We would be more than happy to get your PR. A couple of keys to consider here...
- The SemaphoreSlim was added due to solve the issue that if you have something like a 'LoadingPage' where you might evaluate the state of the user and you might then navigate to the 'LoginPage' or the 'HomePage' from the OnNavigatedTo. This would fail because the Navigation to the 'LoadingPage' did not yet complete.
- We will require one or more tests as makes sense for the scenario(s) you've uncovered. It would be good to have them start with
Issue3047_
so that we can always track the issue back to this GitHub Issue. - You may want to start with adding the tests first to validate that they are failing now and that your changes fix the issue. If you have any additional questions let me know.
from prism.
Related Issues (20)
- [BUG] Expected Navigation Failed. No Root Window has been created. HOT 1
- [BUG][MAUI] EventToCommandBehavior with RelativeSource binding throws InvalidOperationException HOT 4
- [BUG] Content of a ContentPage doesn't occupy full height when page is pushed to PrismNavigationPage HOT 4
- [BUG] When using iOS ModalPresentationStyles that can be automatically dismissed, navigation service gets out of sync & stops working with NavigationPage HOT 2
- [BUG] Unable to unregister the service using the Prism.Maui HOT 1
- No Root Window has been created HOT 1
- [Feature Request] Add support Keyed Service for IServiceCollection HOT 2
- Resolving with Unity works, not with DryIoc HOT 3
- [Enhancement] GetNavigationUriPath For Maui HOT 3
- [BUG] Android "hardware" back button closes the app when app contains a tabbed page with a navigation page as root page for one of the tabs HOT 1
- [BUG] Getting exception while navigating in Release mode on iOS HOT 19
- [BUG] [Android] Open app from url scheme crashes app HOT 3
- [BUG] Navigation Title view is not getting displayed on IOS HOT 2
- [BUG] Navigation Title view is not getting displayed with .net 8.0 on Andriord and IOS HOT 4
- [BUG] BindingContext cleared when performing absolute navigation HOT 3
- [Enhancement] NavigateFrom
- [Enhancement] Add ability to switch tabs and navigate
- [BUG] Android "hardware" back button closes the app when app contains a tabbed page with a navigation page as root page for one of the tabs, Take 2 HOT 4
- [BUG] Popup Dialogs are hidden/covered by calling Page when called after returning from MAUI FilePicker HOT 2
- [BUG] Link to Prism License T&C is wrong HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prism.