Using StatusBar in the Windows Universal App

I am trying to retrieve a StatusBar object from a view constructor using the following code: bool mobile = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract",1,0); if(mobile) { var statusbar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); }

Using Visual Studio Community 2015, I get the following errors: Error CS0731 The type forwarder for type 'Windows.UI.ViewManagement.StatusBar' in assembly 'Windows' causes a cycle Error CS1069 The type name 'StatusBar' could not be found in the namespace 'Windows.UI.ViewManagement'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly.

According to Microsoft , this class must be present. I even added a dependency on Package.appxmanifest for the mobile device family and still nothing. Any ideas?

+4
source share
1 answer

You should add the Microsoft Mobile Extension SDK

enter image description here

+10
source

Source: https://habr.com/ru/post/1608573/


All Articles