With this post I work on integration SP2010 with Silverlight 5, Prism 4.1 and MVVM.
Getting your developmant environment up to date with SL5
- Start with Windows server 2008 R2 / .NET4.0 / VS2010 SP1 /SQL 2008 (any version) / SP2010 (Foundation or server)
- get up to date with Silverlight 5 according to https://rasor.wordpress.com/2012/08/16/c-book-samples/#prism
Integrate SL5 into SP2010
- Create a SP SiteCollection via CA or reuse one where you are SiteColl Admin
- Add http://sl5spdemo.example.xx to your hosts file or DNS.
- From CentralAdmin Create a Sharepoint Webapplication (if you are not reusing one) e.g. http://sl5spdemo.example.xx
- Port: 80
- Host Header: sl5spdemo.example.xx
- Create new Application Pool: SharePoint – sl5spdemo.example.xx80
- AppPool user: example\SPAppPoolAcc (or whatever is your preference)
- Database: WSS_Content_sl5spdemo80
- Click the Create Site Collection link
- Title: SL5 Root
- Template: Team site (this includes “Shared Documents” DocLib)
- SiteColl admin: example\<your-userid>
- Test by going to http://sl5spdemo.example.xx
- Connect VS2010 to the SiteColl
- Run VS2010 as admin
- Open Server Explorer – SP Connections – Add – http://sl5spdemo.example.xx/
- Create a SL5 app
- In VS – New – Project – Silverlight – Silverlight App – Name: SL5Demo1
- Uncheck “Host the SL App in a new web site”. We want to use a simple Html page as host. VS wilk dynamicly make one, when debugging.
- Test the app with “F5”. An empty page appears hosted by \SL5Demo1\SL5Demo1\Bin\Debug\SL5Demo1TestPage.html
- Let us play TV cooks and start with the BasicMVVMQuickStart.
- Open that project and set BasicMVVMApp as the startup project.
- Test run the app with “F5”. You now have a basic MVVM sample. You can use any other QuickStart from Prism4.1 if you like.
- The SL RIA file will be located in \Prism41\Quickstarts\BasicMVVM\BasicMVVMApp\Bin\Debug\BasicMVVMApp.xap
- Add a SL RIA to SP as a Shared Document
- Goto Shared Documents: http://sl5spdemo.example.xx/Shared%20Documents/Forms/AllItems.aspx
- Upload BasicMVVMApp.xap to above folder.
- RightClick the filename to retrive the SP path: http://sl5spdemo.example.eu/Shared%20Documents/BasicMVVMApp.xap
- SiteActions – New Page – Name: SL5WebPart1
- Insert Tab – WebPart – Media&Content – SL WebPart – Add
- Url: //Paste the url to the xap file.
- Save the SP page
Adding SL to ASP.NET