How to use Silverlight XAML views as if they were MVC views
I recently got into Silverlight development. So far, I've managed to create one Silverlight XAML view that pulls data from a SQL Server database using ADO.Net Entity Framework and displays the data in a Silverlight DataGrid. I can also perform simple editing and update functions and save it back to the database. At this point, my understanding fails. From what I am assembling, the Silverlight client application is hosted inside an ASP.NET or ASP.Net MVC web application. I usually just create a website using ASP.Net MVC and used a few jQuery controls, etc. to bring the interface to life on each view. How can I use these various Silverlight XAML views that I create in my ASP.Net MVC application like MVC Views? Am I missing something here?
source to share
RIA models
There are two different models for integrating Silverlight (or any RIA technology) into your site:
- Silverlight application hosted on a simple website
- Silverlight controls are integrated into a website with different interactions (forms, jQuery, etc.).
Any model works well, it is up to you to decide which one works best for your scenario.
Silverlight Server Communication
Your Silverlight application is a browser-hosted plugin, so it's best to think of it as jQuery or other client-side code. There are several ways to communicate with the server:
- RIA services
- ADO.NET Data Services
- Custom WCF Service
- Other REST / SOAP communications you create yourself
Silverlight supports WebClient and HttpWebRequest, so you can get as low-level as you would like in your client-server message. I really recommend looking at RIA services as it handles not only communication but validation rules as well.
Silverlight HTML / Javascript Integration
Silverlight can be called and called from Javascript through an HTML bridge . This means that your Silverlight components can be tightly integrated with your web page as you see fit. Silverlight can also interact directly with DOM settings and read form values, changing CSS properties, and more. You can do whatever you would do in Javascript over an HTML bridge if you like.
source to share
To update your data model from a Silverlight application (which runs on your client machine), you need to use WCF (Windows Communication Foundation) . The Silverlight app will communicate with your server using WCF, and none of this has anything to do with how you serve the Silverlight app (whether you're using Webforms or MVC).
source to share