Caliburn Micro WinRT State Handling
Is there support for Suspend and Resume in Caiburn Micro's WinRT version? If so, this is the answer how can I implement Suspend / Resume functionality with this architecture. I do not believe that a full fledged architecture like micron gauge does not support state handling.
Also how can I keep the navigation during deactivation, something like the navigation behavior of a Windows phone.
Please help me to solve this problem.
source to share
There are several documentation pages on the subject - it's been a while since I was working with caliburn.micro, so I'm not sure if they will fully answer your question, but here you go:
Screens, conductors, and composition
The gist of this is "Inherit from screen". This will give you methods OnActivate()
and OnDeactivate()
to redefine, among other things. You can use them to pause and resume your application.
Also, support for "Tombstoning" for WP7 in caliburn.micro via StorageHandler
- perhaps the corresponding classes are available for WinRT as well. Here's some documentation on these:
source to share
As mentioned in another answer, I think OnActivate () and OnDeactivate () are not ideal solutions for handling "headstones" in WinRT. These overrides fire only once, when the view becomes active or destroyed, not every time the view goes out of focus and returns.
I have yet to come across the Suspend / Resume function in Caliburn.Micro WinRT.
But this can be easily achieved with the .NET framework. Follow this msdn for complete details .
Shortly speaking,
for navigation Navigation and return (app minimized and resumed) use below event in ViewModels:
Window.Current.VisibilityChanged += OnVisibilityChanged;
to handle suspend / resume overrides OnSuspending and OnResuming in your application class.
source to share