Very soon i will be allocated to a Silverlight project again after 2 years++ apart from this technology.
OK, time to refresh the knowledge. A good sweet start point is to create a solution with Silverlight + RIA services + Entity Framework with VS2012, here we go:

1. Create a new ‘Silverlight Business Application‘ and it will automatically create a Web application for the RIA services.

SimpleSilverlight

2.Add a new ADO.NET Entity Data Model under Folder ‘Models‘ in Web application.

ADONET

3. Rebuild the Web Solution. Very important step before you proceed to playing around with domain services.

4.  Open your entity model in the designer, change the “Code Generation Strategy” from “None” to “Default”
5.Delete the two “.tt” files that are adjacent to the model
6. Rebuild the project.
Why we need to have step #4,#5 and #6? Please go to http://stackoverflow.com/a/14534060

7. Add a new “domain services class“under “Services” folder.

DomainServices

8. Domain services class configuration:

DomainServicesConfig

9.Create a new “Silverlight Page” under Silverlight projectView” folder.

10. Open the new page and drag a DataSource object to the new XAML page you created in previous step.

11.Go to MainPage.xaml, search for the following paragraph, replace the orange color string with the new xaml page name you created in previous step:  <HyperlinkButton x:Name=”Link1″ Style=”{StaticResource LinkStyle}”
NavigateUri=”/Home” TargetName=”ContentFrame” Content=”{Binding Path=Strings.HomePageTitle, Source={StaticResource ApplicationResources}}”/>

12. F5 and check your work!

Result

Advertisements