Lock Orientation for UWP Application

I recently needed to prevent screen rotation in a UWP application when running on a mobile device, but the application itself supports all orientations (Landscape, Portrait, LandscapeFlipped, PortraitFlipped). In order to achieve my desired result, I added a quick static method that I found here. This goes in App.xaml.cs:

Now, in my MainPageViewModel.cs, my Read more about Lock Orientation for UWP Application[…]