Giter Site home page Giter Site logo

Comments (3)

thefex avatar thefex commented on June 15, 2024

Mentioned that in other commit.
"a) There is a need to customize "Tag" which is used to identify different fragment instances. Sometimes we do not have control on chosen Fragment tag. ViewPager is an example. (yes we can hack that, cause support viewpager gives "android:switcher" + viewpagerid + ":" + pageindex as tag - but it's just workaround, we gonna fall into this kind of problems over and over again)

Although I have provided overridable method in CachingActivities - GetFragmentTag(Fragment ..) it is useless.
The only way to differentiate same fragment type instances is to use some information provided by viewmodel (like some fragment title/id - information contained in viewmodel).

Problem is: ViewModel is not accesable on PostCreate. ViewModel is set during Fragment.OnViewCreated - too late."

As I've been fixing other issues - I am now sure that we can not use any information from ViewModel - it is not possible to make it works.

I have a pretty good idea in mind:

  • lets make Register method in caching activites internal,
  • Register method should allow to multiple calls with same parameters passed (let it do nothing in that case)
  • if Fragment has MvxOwnedViewModel registration should be done automatically - we just need to find the best moment to do that - perhaps Fragment OnAttach ?

from mvvmcross-androidsupport.

thefex avatar thefex commented on June 15, 2024

oh and the by the way - registration dictionary must be serialized on instance save, deserialized on activity postcreate

from mvvmcross-androidsupport.

thefex avatar thefex commented on June 15, 2024

oh that's not closed yet! please reopen the issue, I've just finished bug-fix which provides "auto-register". Gonna merge that tomorrow, when I wake up ;-)

from mvvmcross-androidsupport.

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.