The trick is to first add a link to the Microsoft Mobile Extension SDK. Then the code looks like this:
StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); await statusBar.HideAsync();
The link can be added by right-clicking on the universal project. Select "Add Link." In the Link Manager dialog box, select Windows Universal on the left. Select "Extensions" and check the "Microsoft Mobile Extension SDK ...".

Since this is a universal application, it will work on every device, but the API will be available only on mobile devices (aka Phones) with Windows 10. Therefore, the function detects whether this API is available at run time before you actually call the API. Otherwise, it will throw a TypeLoadException at runtime.
Use the Windows.Foundation.Metadata.ApiInformation namespace to find out if the API is accessible. (For example, the IsTypePresent () method. I recommend working with typeof instead of Strings here, e.g. for example:
var isStatusBarPresent = ApiInformation.IsTypePresent(typeof(StatusBar).ToString());
You can learn more about adaptive code here: https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/08
Daniel Meixner
source share