Comments (6)
How would you envision removing pages from the back stack from within a view model, where you have no reference to the pages?
Would you do it based on page index? Something like Remove(int pageIndex)?
I have to answer this same question for Xamarin.Forms.
from prism.
Since you navigate to a page based on a logical name associated with that page (done so that view models can request navigation without being coupled to the view), I would expect that we would be able to remove them by logical name as well. Logical name maps to type name based on convention that is overridable. I don't think that should be hard to add.
from prism.
What if you have multiple instances of that view on the stack? How do you choose which instance to remove?
from prism.
Or should we not allow multiple instances to be created and instead always navigate to an existing instance?
from prism.
In our case it was mostly popping the current page off the stack after navigating away from it (as only then it's on the Backstack). As @briannoyes says, navigation happens based on tokens (logical names), so that can be used to remove pages. But as multiple instances can be added to the stack, we'd probably need an extra parameter (e.g. in the idea of 'first', 'last', 'all' with given token).
from prism.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from prism.
Related Issues (20)
- [BUG] Prism.Navigation getParameters failed (empty parameters) HOT 1
- [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 2
- [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 2
- [BUG] BindingContext cleared when performing absolute navigation HOT 2
- [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 1
- [BUG] Popup Dialogs are hidden/covered by calling Page when called after returning from MAUI FilePicker
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.