Skip to content

Commit

Permalink
Fragment registration was called to late. OnSaveInstance could be cal…
Browse files Browse the repository at this point in the history
…led (on API11+) before OnPause -> therefore cache might not work.

Fixes issue MvvmCross#133
  • Loading branch information
thefex committed Dec 2, 2015
1 parent 64527f4 commit b0556c7
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,15 @@ public MvxBindingFragmentAdapter(IMvxEventSourceFragment eventSource)
throw new ArgumentException("eventSource must be an IMvxFragmentView");
}

protected override void HandlePauseCalled(object sender, EventArgs e)
{
base.HandlePauseCalled(sender, e);
if (!FragmentView.GetType().IsFragmentCacheable())
return;

FragmentView.RegisterFragmentViewToCacheIfNeeded();
}

protected override void HandleCreateCalled(object sender, MvxValueEventArgs<Bundle> bundleArgs)
{
FragmentView.EnsureSetupInitialized();

if (!FragmentView.GetType().IsFragmentCacheable())
return;

FragmentView.RegisterFragmentViewToCacheIfNeeded();

Bundle bundle = null;
MvxViewModelRequest request = null;
if (bundleArgs?.Value != null)
Expand Down

0 comments on commit b0556c7

Please sign in to comment.