// Event handler for navigation void OnNavigated(object sender, NavigationEventArgs e) { try { Mowbly.AppNavigatedToInternalPage = true; if (e.Content == callerPage) { // Navigation to caller page. Dispose off stuff. Dispose(); } else if (e.Content is ContactChooserPage) { // Subscribe to OnCompleted event chooserPage = e.Content as ContactChooserPage; chooserPage.OnCompleted += OnChooseCompleted; // Load contacts from device chooserPage.LoadContacts(); } } catch (Exception ex) { Logger.Error("Failed to navigate to view contact page .Reason: " + ex.Message); } }
/// <summary> /// Dispose /// </summary> public void Dispose() { try { if (!isDisposed) { chooserPage.OnCompleted -= OnChooseCompleted; frame.Navigated -= OnNavigated; frame = null; callerPage = null; chooserPage = null; isDisposed = true; } } catch { } }