I have a WinRT "Windows Store" app with two pages: a list page and an edit page. When the user clicks a list item and selects "Edit" from the bottom app bar, I pass the item to the edit page. What I need from there is to support two possible user actions:
If the user navigates back using the Back Button (top navigation), I want the unmodified item to be returned the calling page.
If the user clicks on a supplied "Save" button (on the edit page), I want to update the various properties of the item, save it to a data store and automatically return the modified item to the calling page.
Either way, the calling page needs to update its display with the changes made to the item, if any. I can do most of this, but I can't figure out how to return the item to the calling page. How do I go about this?
Please keep in mind, there will be other pages added to the app going forward (which will also be called from the main "lists" page). I need to make an accommodation such that when I return from a given "child" page back to the lists page, the behavior of the list page will differ based on which page is being returned from. (Hope that makes sense...).
Bonus question: I'd also like to capture the back navigation event to notify the user that the modified item will not be saved and give them the option to continue, save and continue or cancel the return navigation action. Is that possible?
TIA