简体   繁体   English

将Silverlight移植到WPF

[英]Porting Silverlight to WPF

I have a large Silverlight LOB application which I'm trying to port to a desktop WPF application (because of Silverlight's slow death.) 我有一个大型的Silverlight LOB应用程序,我正在尝试移植到桌面WPF应用程序(因为Silverlight的缓慢死亡。)

The xaml & c# code port nicely but the original app uses WCF RIA Services. xaml&c#代码端口很好,但原始应用程序使用WCF RIA服务。 (Over 30,000 lines.) My question is, can I use the same WCF RIA Service with my WPF app? (超过30,000行。)我的问题是,我可以在我的WPF应用程序中使用相同的WCF RIA服务吗?

Thanks 谢谢

Here are a few resources you can use to decide if you want to go down that route 您可以使用以下几种资源来决定是否要沿着这条路线行驶

How to access a WCF RIA web service from a WPF client application 如何从WPF客户端应用程序访问WCF RIA Web服务

How to use WCF RIA SERVICES with WPF application? 如何在WPF应用程序中使用WCF RIA SERVICES?

How to open a WCF RIA Services application to other type of clients: the SOAP endpoint (3/5) 如何向其他类型的客户端打开WCF RIA Services应用程序:SOAP端点(3/5)

They mostly center around: 他们主要围绕:

  1. Exposing a SOAP endpoint to your WCF RIA web service 将SOAP端点暴露给您的WCF RIA Web服务

  2. Accessing the WCF RIA service as a WCF web service from WPF 从WPF作为WCF Web服务访问WCF RIA服务

  3. Using the WCF SoapClient to access WCF RIA DomainService 使用WCF SoapClient访问WCF RIA DomainService

是的,你可以像我以前那样做,但是因为你刚刚点击端点并有效地进行获取或发布,你就失去了ria wcf服务附带的变更跟踪功能。

I don't share the other answerers inclinations to use RIA Services for WPF without having an actual RIA Services client: If you don't use an actual RIA Services client compontent as they recommend, that would usually mean rewriting large parts of your data handling code on the client anyway. 在没有实际的RIA服务客户端的情况下,我不会分享使用RIA服务进行WPF的其他回答者倾向:如果您不按照他们的建议使用实际的RIA服务客户端组件,那通常意味着重写数据处理的大部分内容无论如何,客户端上的代码。

Usually, the auto-generated classes are in a RIA Services app are used everywhere, and their behavior isn't easily remodelled. 通常,RIA Services应用程序中的自动生成的类在任何地方都使用,并且它们的行为不容易重新构建。 In fact that would be really, really difficult to do and you would be better off to just rewrite most of the thing. 事实上,这将是非常非常困难的,你最好只重写大部分内容。 Does your app, for instance, not does binding a save button's Disabled property to XyzContext.HasChanges ? 例如,您的应用程序是否没有将保存按钮的Disabled属性绑定到XyzContext.HasChanges

If your app is typical, you really need the real RIA Serives client for a clean port. 如果您的应用程序很典型,那么您真的需要真正的RIA Serives客户端来获得干净的端口。

Semi-luckily, RIA Services has gone open-source, and WPF support is on their roadmap: OpenRiaServices . 幸运的是,RIA Services已经开源,WPF支持在他们的路线图上: OpenRiaServices

I never used it, and I sense progress on that is a bit slow, but, dending on your own inclinations, it may be a realistic option to use that. 我从来没有使用它,我觉得进展有点慢,但是,根据你自己的倾向,使用它可能是一个现实的选择。 You will just have to expect to be a bit on your own by doing it. 这样你就不得不期待自己有点自负。

Also, do you use any third-party libraries that dependend on RIA Services? 此外,您是否使用任何依赖RIA服务的第三方图书馆? For example, if you use DevExpress, you will also have to port their components that use RIA Services ( RiaInstantFeedbackDataSource , etc.). 例如,如果您使用DevExpress,您还必须移植使用RIA服务的组件( RiaInstantFeedbackDataSource等)。

If you try it, drop a comment on how it went. 如果您尝试一下,请对其进行评论。 I have a RIA Services application about the same size myself. 我自己有一个大小相同的RIA服务应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM