I'm trying to create a UrhoSharp Holographic application that runs as part of a UWP app. The app launches into a 2D UWP view (A), and then can navigate to the 3D view (B). I followed the steps here to launch the 3D view: https://forums.hololens.com/discussion/250/how-to-switch-from-2d-xaml-view-to-3d-holographic-view-directx and created the view by using:
urhoView = CoreApplication.CreateNewView(new UrhoAppViewSource<HelloWorldApplication>());
I can navigate from A -> B and B -> A continually. While doing this the Urhosharp application stays running in its own window when navigating back to view A, I think I navigate back to the same instance of view B. I would like to close (or exit) the UrhoSharp appview B and its window when I navigate from view B, basically completely closing down everything about that window and 3D application. I think this is similar problem as this question: https://forums.xamarin.com/discussion/62370/initialize-exit#latest, but specifically on the Hololens.
To navigate back from view B, I use:
I've tried different combinations of calling this.Exit() and Window.Current.Close() in view B, but it either crashes before navigating back to A, or successfully navigates back to A, but then trying to navigates back to B the app will crash.
What is the correct way to manage this navigation? I've looked at the UWP MultipleViews examples, but I think there are some extra steps to manage the navigation when using UrhoSharp.