0

The Situation:

I have a software project written in .NET 4.0 with a WinForms UI. I would like to replace the UI with a Silverlight UI.

The application should work across the web. The reason for using Silverlight and not WPF is platform independence, so the UI might be running on a different OS eventually.

Example: the .NET program produces some data, I would like to plot the data in a Silverlight control.

The Problem:

My .NET project uses libraries that are incompatible with Silverlight. Rewriting the entire .NET code in Silverlight would take a very long time.

The Question:

What would be a good way to combine the .NET part with the Silverlight part?

Should I add some middle layer to have the two programs communicate with each other, and if yes, what should I use? (I have never done this kind of thing before)

Is there a way to directly call a Silverlight function from a .NET class, e.g. SLGUI.display_data(dotNET_data), or the other way round?

Phasma
  • 232
  • 2
  • 16

1 Answers1

2

The best way to do something like this, is to refactor your code to create a web service and call these from the SL App.

Ali Khalid
  • 1,345
  • 8
  • 19
  • Thanks for your reply. What is the difference between a webservice and a WCF RIA service? I am somewhat confused by all the different terms I have come across while looking around for answers. WCF, RIA, Entity Framework, ASP.NET, LINQ, ... – Phasma Feb 29 '12 at 10:53
  • See this http://stackoverflow.com/q/2523629/394381 to understand the difference between Web services and WCF RIA. BTW Entity Framework = ORM, LINQ = "Dont worry to much about this", WCF = new way to do web services and ASP.NET = to build websites in suported .NET languages. – Ali Khalid Feb 29 '12 at 11:50
  • Thanks. I just followed [Deborah Kurata's tutorial on Silverlight and RIA](http://msmvps.com/blogs/deborahk/archive/2009/11/05/silverlight-ria-services-and-your-business-objects.aspx) to send some data from the .Net to the Silverlight part. – Phasma Feb 29 '12 at 14:06
  • Your welcome, can you click on the tick to accept this answer. – Ali Khalid Feb 29 '12 at 14:09
  • this is the best option you have considering the effort and time that will be used compared against porting the non-SL stuff into SL. – Bahamut Feb 29 '12 at 15:59
  • Bahamut, do you mean WCF RIA or webservices? – Phasma Mar 01 '12 at 09:26