C# 非silverlight应用程序中部署类的替代方案

C# 非silverlight应用程序中部署类的替代方案,c#,windows,xaml,silverlight,windows-phone-8.1,C#,Windows,Xaml,Silverlight,Windows Phone 8.1,在Silverlight应用程序中,是否有任何其他方法可以使用部署类或其他与部署类具有相同用途的类。 我正在实现一个非silverlight应用程序(移动应用程序),其中我写了一行如下: Deployment.Current.Dispatcher.BeginInvoke(() => lblTranslatedText.Text = strTest); 然后它向我展示了: 名称部署在当前上下文中不存在 我尝试了各种可能性,比如System.Windows.Deployment,因为它是非s

在Silverlight应用程序中,是否有任何其他方法可以使用部署类或其他与部署类具有相同用途的类。 我正在实现一个非silverlight应用程序(移动应用程序),其中我写了一行如下:

Deployment.Current.Dispatcher.BeginInvoke(() => lblTranslatedText.Text = strTest);
然后它向我展示了:

名称部署在当前上下文中不存在


我尝试了各种可能性,比如
System.Windows.Deployment
,因为它是非silverlight应用程序,所以我无法使用部署类。请给我建议一个解决方案。

对于Windows运行时应用程序,您将使用Windows.UI.Core。对象的方法。您通常可以从应用程序的当前窗口获取:

await Window.Current.Dispatcher.RunAsync(...);


我已经尝试了这两种方法,它向我展示了使用Windows.UI.Core.CoreDispatcher时的类似情况。CoreDispatcher不包含BeingInvoke的定义,并且找不到接受BeingInvoke并接受使用Windows.UI.Core.CoreDispatcher类型的第一个参数的扩展方法(是否缺少using指令或程序集引用?)我编写了一个汇编指令,比如使用WIndows.UI.Core;哦。很抱歉。RunAsync与BeginInvoke类似。
await CoreWindow.GetForCurrentThread().Dispatcher.RunAsync(...);