I would like to create something like CameraCaptureUI.CaptureFileAsync which will return the result to caller (location that user picked through bing maps in my case)
(the same question was asked here but I still need full screen UI or more complete code example)
Assuming the next use case:
- CallerPage1 Navigate-> CallerPage2 (through Frame.Navigate(typeof(CallerPage2)) )
- CallerPage2 Navigate-> LocationPickingPage (again through Frame.Navigate(typeof(LocationPickingPage )) <- here should be something else but not Frame.Navigate)
- User picks a Location and presses done -> location object returned to CallerPage2
(through Frame.Navigate(typeof(CallerPage2)) )
And now if user presses back on CallerPage2 he/she will be navigated back to LocationPickingPage which is expected in navigation model described above but I wont to navigate him/her to CallerPage1
So this is how CameraCaptureUI.CaptureFileAsync behaves.
Maybe someone can help to look “behind the scenes” of CaptureFileAsync or familiar method and provide some example of how it can be implemented so that location picking can be performed like this:
Location location = await new LocationPickCaptureUI.CaptureLocationAsync();
Any help would be appreciated!
Edit
So, maybe someone can shad some light on how pages can share their data without affecting navigation history. I’m just looking for something like android’s startActivityForResult.
I spend several days on this problem (msdn docs, researching different examples, forums and different sites including this one) and didn’t find any approach so I think it is time to ask own question.
Sharing data between pages in manner I am looking for should be something obvious. Maybe I was looking in a wrong way but the problem is still persist’s.
And please, if someone votes down my question share your mind and your source of knowledge as I still need help on this problem.
Thanks in advance
So, finally I’ve got an appropriate solution and maybe it can be helpful to anybody else.
The idea is to use Popup object and fit all the screen (however the details seemed like some kind of magic 🙂 )
One thing: I used UserControl (in Visual Studio right click on project -> Add -> new item.. -> UserControl) template as in this scenario it is easy to manage popups’s content
Here is the full source for C#:
CustomCaptureUI.xaml:
CustomCaptureUI.xaml.cs:
And then it can be used like this:
Hope it can save someone’s time a little