Open your Visual Studio and click new project and select Silverlight Business Application template as shown below;
Please note that the Silverlight Business Application Template will only appear after you had installed the Silverlight 4 RIA toolkit. Check your Solution, there should be two projects on it: projectname and the projectname.web
Right Click on projectname.web, then add new item select ADO.Net Data Entity Model. This will define our data connection strings. After you click "add" button the entity data model wizard will show. Follow all the instruction provided by the wizard.
Build the projectname.web then right click on "services" folder and add new item select Domain Class controller item;
Enable all the checkboxes as shown;
Build again the projectname.web. Then go to the projectname, right click add service reference and click ok.The projectname solution should now have a service reference folder.
Go to the View folder and select home.xaml. Click on the Data Sources and you should be able to see the domain data class context that we added in the projectname.web. Drag and drop the table to your Xaml page and RIA will automatically generate your data.
Now we have successfully show our data in our Silverlight page without typing a single line of code. RIA will do it for you. But of course there are some considerations. In our example, we have already a Silverlight page which display data in grid view.
More tips on my next blog. Thank you!







No comments:
Post a Comment