There is an open issue on Github regarding this, see https://github.com/Caliburn-Micro/Caliburn.Micro/issues/95. I describe my solution in a comment there https://github.com/Caliburn-Micro/Caliburn.Micro/issues/95#issuecomment-124473140.
Basically, you should use the CachingFrameAdapter
available in the 3.0.0 branch by directly using the 3.0.0 branch or taking the CachingFrameAdapter
out of it and using it in your code with the current Caliburn version (2.x).
If you take the second route as I did, add CachingFrameAdapter
to your project and replace the PrepareViewFirst
in your App.xaml.cs
to this
protected override void PrepareViewFirst(Frame rootFrame)
{
RegisterNavigationService(rootFrame);
}
public INavigationService RegisterNavigationService(Frame rootFrame, bool treatViewAsLoaded = false)
{
if (rootFrame == null)
throw new ArgumentNullException("rootFrame");
var frameAdapter = new CachingFrameAdapter(rootFrame, treatViewAsLoaded);
container.RegisterInstance(typeof(INavigationService), null, frameAdapter);
return frameAdapter;
}