面向 Windows 应用商店、iOS 和 Droid 的可移植类库中的异步/等待 [英] Async/Await in portable class library targeting Windows Store, iOS and Droid
问题描述
开发面向 Android 和 iOS (Xamarin/Mono) 以及 Windows Store 的 MvvmCross 应用程序(因为与 iOS/Android 相比,调试起来非常简单/快速).
Developping an MvvmCross application targeting Android and iOS (Xamarin/Mono) and Windows Store (because it's so easy/fast to debug compared to iOS/Android).
应用的核心是基于 PCL.
The Core of the app is PCL based.
是否可以在核心库中使用 Async/Await?
Is it possible to use Async/Await in the Core library?
Xamarin mono 支持 Async/Await,Windows 应用商店也支持.但是,当仅选择 Net4.5、Windows Store、Mono Android 和 MonoTouch 作为 PCL 目标时,SL4 和 WP7.5 会被自动选中,并且 Async/Await 不再可用.
Xamarin mono supports Async/Await, and Windows Store supports it. However, when selecting only Net4.5, Windows Store, Mono Android and MonoTouch as the PCL targets, SL4 and WP7.5 get automatically selected and Async/Await is not availlable anymore.
推荐答案
我最新的是:mvvmcross 的 PCL 上的 TPL
但是 Xamarin 的 PCL 支持已于上周正式推出 - 所以我拥有的最新版本已经过时.Miguel 已承诺在他从 Build 返回时发布一篇关于当前状态的博文.
But PCL support from Xamarin has officially launched in the last week - so the latest I have is be out of date. Miguel has promised a blog post on the current status when he returns from Build.
此外,我还看到了诸如我正在使用 asyncbridge 和 profile47 并在 PCL 中大量使用异步.在 iOs 和 Android 上完美运行,MvvmCross 事件看起来像一个魔术"来自 http://forums.xamarin.com/discussion/comment/18872/#Comment_18872 - 会喜欢看到它更完整的博客,解释,记录它工作的人.
Also, I have seen user comments like "I'm using asyncbridge and profile47 with heavily usage of async inside PCL. Works perfect on iOs and Android, with MvvmCross events it looks like a magic" from http://forums.xamarin.com/discussion/comment/18872/#Comment_18872 - would love to see this more fully blogged, explained, documented by those who have it working.
这篇关于面向 Windows 应用商店、iOS 和 Droid 的可移植类库中的异步/等待的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!