I am developing a barcode scanner, my MainPage has a CaptureElement
in full screen. I have two other pages that I navigate to: HystoricalPage and AboutPage. To stop the async when I navigate from MainPage to one of the others pages I use the Dispose();
method in my OnNavigatedFrom. Like this:
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
_mediaCapture.Dispose();
}
With this I navigate between pages just fine, sometimes when I go back to may MainPage the CaptureElement
does not reinicialize but that is not my issue right now. My issue is the following:
When I am in one of my pages and press the home button and after come back to my app; press the search button and after come back to my app; when I hold the back button and after come back to my app. In all this situations my application crashes. I read that it might be fixed using the resuming and the suspending events, but I don't know how to add those events to my application. If anyone could help me I'd apreciate. Thanks!