You want to write code that runs only on a specific device family, in your case is Windows Mobile. To do that, add Window Mobile Extensions for the UWP.

As mentioned above you can add code in App.xaml.cs. It's oke, but I recommend first to check which platform will be used.
Here is a small snippet:
private void InitializeThemes()
{
switch (AnalyticsInfo.VersionInfo.DeviceFamily)
{
case "Windows.Mobile":
StatusBar statusBar = StatusBar.GetForCurrentView();
break;
case "Windows.Desktop":
ApplicationView applicationView = ApplicationView.GetForCurrentView();
break;
}
}
As mentioned in the comments, the above solution is not suitable in your situation. Instead use the method that was described in @Depechie answer.