GithubHelp home page GithubHelp logo

Comments (6)

brianlagunas avatar brianlagunas commented on May 22, 2024

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.

briannoyes avatar briannoyes commented on May 22, 2024

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.

brianlagunas avatar brianlagunas commented on May 22, 2024

What if you have multiple instances of that view on the stack? How do you choose which instance to remove?

from prism.

brianlagunas avatar brianlagunas commented on May 22, 2024

Or should we not allow multiple instances to be created and instead always navigate to an existing instance?

from prism.

bartlannoeye avatar bartlannoeye commented on May 22, 2024

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.

lock avatar lock commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.