0

I'm trying to open only one instance of a ViewModel and it's bound View. However, when I call base.ShowViewModel<SecondViewModel>() in my FirstViewModel it always creates a new View and does not update the one I created before.

I tried all LaunchModes for the Activity but it does not hit OnNewIntent() method in any case.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
timu
  • 165
  • 1
  • 6
  • What did you change the `LaunchMode` to? – Cheesebaron Aug 27 '14 at 16:08
  • see this http://stackoverflow.com/questions/16723078/mvvmcross-does-showviewmodel-always-construct-new-instances – RyanWang Aug 28 '14 at 09:20
  • For creating singleton ViewModel instance, see https://github.com/MvvmCross/MvvmCross/wiki/Customising-using-App-and-Setup#overriding-viewmodel-locationconstruction . For creating single views, that will require some custom presenter and Android specialness - see the suggestions/hints from the previous comments – Stuart Aug 28 '14 at 12:23

0 Answers0