2015-09-22 33 views
3

我嘗試使用下面的代碼來檢索視圖構造函數中的狀態欄對象: bool mobile = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract",1,0); if(mobile) { var statusbar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); }在Windows通用應用程序使用狀態欄

使用Visual Studio 2015年的社區,我得到以下錯誤: 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.

根據Microsoft,該類應該存在。我甚至爲Mobile設備系列添加了對Package.appxmanifest的依賴關係,但仍然沒有任何結果。有任何想法嗎?

回答

8

您應該添加微軟移動擴展SDK

enter image description here

相關問題