Hi,
I'm currently using a Navigation Window as a "container" to navigate the various pages of my app. Upon the application closing, I would like to execute some code before it completes exit. This code only needs to execute for one particular page and not all pages.
I've tried placing the code within the pages "unloaded" event handler - and this does execute when using the navigation service to navigate to another page. However, if the "X" close button is pressed, it does not trigger the "unloaded" event handler. I understand that the NavigationWindow has "OnClosing" and "OnClosed" event handlers - however I do not have access to the variables from the Page required to execute the code. Furthermore, I do not wish for the code to execute if the current page is not that specific page. I have tried to make the NavigationService navigate to another page within the "OnClosing" event (in order to trigger the page's "Unloaded" event handler), however this did not work successfully.
Any help on achieving this would be greatly appreciated!
Thanks!