Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MvxViewPagerAdapter and MvxStateViewPagerAdapter ignore the presence of view model instance inside MvxViewPagerFragmentInfo #2718

Closed
1 of 7 tasks
wh1t3cAt1k opened this issue Mar 23, 2018 · 2 comments
Labels
p/android-support Android Support Packages platform t/bug Bug type
Milestone

Comments

@wh1t3cAt1k
Copy link
Contributor

wh1t3cAt1k commented Mar 23, 2018

Steps to reproduce 📜

  1. Use tab layout with a view pager.

  2. Use e.g. MvxViewPagerAdapter for the view pager. Initialize it with a single-element collection MvxViewPagerFragmentInfo object that contains a view model INSTANCE which cannot be directly resolved from the IoC container (e.g. it is manually created with parameters from the parent page view model)

  3. Try to open that page

  4. 💥

Expected behavior 🤔

Both MvxViewPagerAdapter and MvxStateViewPagerAdapter should check whether the fragment info already contains the view model instance, and if yes, do not try to Mvx.Resolve that.

Actual behavior 🐛

Crash with a dependency resolution exception.

Configuration 🔧

Version: 5.7.0

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
@nmilcoff
Copy link
Contributor

This needs to be considered in #2440

@nmilcoff nmilcoff added the p/android-support Android Support Packages platform label Mar 23, 2018
@nmilcoff nmilcoff added this to the 6.0.0 milestone Mar 23, 2018
@wh1t3cAt1k
Copy link
Contributor Author

wh1t3cAt1k commented Mar 23, 2018

I would like to contribute under this issue separately, because I don't yet feel the strength to completely clean-up these adapters in the scope of #2440 . I am currently preparing a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/android-support Android Support Packages platform t/bug Bug type
Development

No branches or pull requests

4 participants