1 / 15

Module 10 Developing Silverlight Applications for SharePoint

Learn how to create, deploy, and debug Silverlight applications for SharePoint 2010, integrate Silverlight with SharePoint, access SharePoint data, and implement asynchronous communication. Explore deploying, debugging, and displaying Silverlight applications on SharePoint sites with custom web parts.

stanleyp
Download Presentation

Module 10 Developing Silverlight Applications for SharePoint

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module 10 Developing Silverlight Applications for SharePoint

  2. Module Overview • Creating Silverlight Applications for SharePoint 2010 • Deploying and Debugging Silverlight Applications for SharePoint 2010 • Lab: Developing Silverlight Applications by Using the SharePoint Client Object Model

  3. Lesson 1: Creating Silverlight Applications for SharePoint 2010 • Silverlight Integration with SharePoint 2010 • SharePoint Client Object Model DLLs for Silverlight • Accessing SharePoint Objects and Data in Silverlight Applications • Asynchronous Communication Between Silverlight and SharePoint

  4. Silverlight Integration with SharePoint 2010 • Microsoft Office SharePoint Server 2007 object model only available from a server in the farm • SharePoint Web services • You could create your own client and/or server objects for Silverlight • SharePoint Server 2010 provides the client object model • Silverlight-specific implementation • SharePoint Server 2010 provides Silverlight Web Parts

  5. SharePoint Client Object Model DLLs for Silverlight • Silverlight implementation • Rationale • DLL location • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin • DLL deployment • With XAP file

  6. Accessing SharePoint Objects and Data in Silverlight Applications • ClientContext objects • Initializing to current SharePoint site collection • Adding using statements for Microsoft.SharePoint.Client and System.Threading • App.xaml.cs • User control • Initializing to remote SharePoint site • Same pattern as the .NET implementation of the SharePoint client object model for other objects private void Application_Startup(object sender, StartupEventArgs e) { ApplicationContext.Init(e.InitParams, SynchronizationContext.Current); this.RootVisual = new MainPage(); } ... clientCtx = new ClientContext(ApplicationContext.Current.Url); ...

  7. Asynchronous Communication Between Silverlight and SharePoint • Rationale • Do not block the main UI thread • ExecuteQueryAsync method • Success callback procedure • Failure callback procedure • Updating the user interface from callback procedures • Switch thread context back to main UI thread • Code sample

  8. Lesson 2: Deploying and Debugging Silverlight Applications for SharePoint 2010 • Deploying Silverlight Applications to SharePoint • Displaying Silverlight Applications in SharePoint 2010 Sites • Developing Custom Web Parts for Displaying Silverlight Applications • Debugging Silverlight Applications

  9. Deploying Silverlight Applications to SharePoint • Deploying Silverlight XAP files • ClientBin folder • SharePoint document library • Deploying other assets • ClientBin folder • SharePoint document library

  10. Displaying Silverlight Applications in SharePoint 2010 Sites • Built-in Silverlight Web Part • Media category • Silverlight Web Part properties • Width and Height • Initiation parameters • Embedding client-side HTML for rendering Silverlight applications <object data='data:application/x-silverlight-2' type='application/x-silverlight-2'>" <param name='source' value='_layouts/clientbin/myapp.xap'/>" <param name=initParams' value='bg=#FFFFFF,fg=#0000FF/>" </object>

  11. Developing Custom Web Parts for Displaying Silverlight Applications • Built-in Silverlight Web Part supports parameters • In some cases you might not want to enable users to supply the parameters • Develop your own Web Part so that you can supply your own parameters directly • Develop your own Web Part so that you can include client-side error-handling routines protected override CreateChildControls() { string renderSLApp = "<div id='mySilverlightHost'>" + "<object data='data:application/x-silverlight-2'" + " type='application/x-silverlight-2'>" + "<param name='source' value='_layouts/clientbin/myapp.xap'/>" + "<param name=initParams' value='bg=#FFFFFF,fg=#0000FF/>" + "</object></div>"; this.Controls.Add(new LiteralControl(renderSLApp)); }

  12. Debugging Silverlight Applications • Silverlight applications run in the user’s browser • No server-side process to attach to • Attaching the debugger • IExplore.exe • Silverlight debug setting

  13. Lab: Developing Silverlight Applications by Using the SharePoint Client Object Model • Exercise 1: Creating a Silverlight Application • Exercise 2: Developing the Silverlight Application Logon information Estimated time: 60 minutes

  14. Lab Review • How did Silverlight communicate with SharePoint? • Was the communication synchronous or asynchronous? • Why? • Where did you deploy the Silverlight XAP file? • How was the Silverlight application displayed in SharePoint? • How did you render media files in Silverlight?

  15. Module Review • In this module, you have learned to: • Develop and deploy Silverlight applications to SharePoint • Display Silverlight applications in SharePoint 2010 sites

More Related