In WP8.1 or WPF desktop apps I could create my ViewModel as a static instance in App.xaml.cs and refer to it throughout the app as "App.myViewModel" but in UWP that does not seem to work (perhaps by design?).
The reason I want a global ViewModel is that, like many apps, I have one main page that populates the VM by downloading info from websites (I'm working on a business based RSS Reader for a client) and when I navigate to another page then come back to MainPage my vm is empty again (as I appear to have no option but to declare it in MainPage) so I have to reload all the data every time.
Also if I want to access the VM from navigated pages I now have to pass a reference to the VM through to that page whereas with the global approach I could still access App.myViewModel.
The only time I alter the VM contents is from UI actions on the Mainpage so I just want to be able to navigate back to the main page from other pages and have the VM still intact.
Can someone please explain how this is done in UWP? Can I still use App.xaml.cs and if so, how? If this is not possible why was it designed like this?