AeroGear 在 Windows 10 方面的新特性
Windows 10 ***個預覽版已經發布很長時間了,而且也很快發布最終版本(29 July)。AeroGear 開發可以關注一下***的一些改進,其中***的改進是不再需要 2 個不同的二進制包,同樣的代碼可以在 Windows 桌面,平板和手機上運行(甚至是 Xbox)。這意味著如果你想遷移你的應用,或者你有 `#if`狀態,你需要修改他們,運行下面代碼檢測:
- using Windows.Foundation.Metadata;
- // you used to have
- #if WINDOWS_PHONE_APP
- // something for hardware buttons
- #endif
- // now you can use Metadata to make it a runtime check
- if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
- {
- HardwareButtons.BackButtonPressed += BackButtonHandler;
- }
runtime-check.cs hosted with ❤ by GitHub
想要使用 Mobile specific API 你需要添加 Mobile Extension SDK:
這不是說你的應用不能在桌面運行,所以你需要運行上面的測試,你也可以選擇繼續只在手機上運行。
Visual Studio 2015 還不能自動處理這些,這里提供一個強大的 shell script,可以把很多事情自動化處理。
還有一個 Windows 10 方面的新特性是 'metro' 應用不再默認全屏幕啟動。
更多 Windows 10 方面的新特性請看這里。