Download presentation
Presentation is loading. Please wait.
1
Shawn Wildermuth AgiliTrain Microsoft MVP (C#), MCSD Silverlight in SharePoint WebParts You got peanut butter in my chocolate
2
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Who Am I? Shawn Wildermuth ▫ shawn@agilitrain.com ▫ C# MVP, MCSD, MCT, INETA Speaker, Author AgiliTrain ▫ Silverlight for SharePoint – Atlanta, June 2-4, 2009 ▫ Silverlight Tour – Atlanta, July 20-22, 2009 ▫ Advanced Silverlight – Atlanta, August 3-4, 2009
3
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Agenda Why Silverlight? SharePoint Integration ▫ Linking Projects ▫ Hosting in SharePoint ▫ Using Web Services ▫ Debugging
4
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 What’s SharePoint? I am not a SharePoint Expert… ▫ …Some of the Techniques Here May Be Hacky… ▫ Goal is to show how it *can* work ▫ So you can apply it to your exceptional SharePoint Skills
5
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 SharePoint
6
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Why Silverlight in SharePoint Leave to SharePoint (and Web) What They Do Well ▫ Silverlight for Islands of Content ▫ Where Graphics and Interactivity Helps ▫ Don’t Overuse it
7
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Using Silverlight in WebPart Project Can Create Silverlight in Same Solution ▫ No Official Linking ▫ Must Do Manually Post-Build, Shared File, MSBuild ▫ Add XAP to WebPart XML file for Deployment
8
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Using Silverlight in WebPart Project WebPart.xml ▫ May be better as separate module <File Path="SilverlightTaskViewer.webpart" Url="SilverlightTaskViewer.webpart" Type="GhostableInLibrary" /> <File Path="SilverlightTasksWidget.xap" Url="SilverlightTasksWidget.xap" Type="GhostableInLibrary" />
9
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 New Silverlight Web Part
10
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Hosting in SharePoint WebPart Can Create HTML Code ▫ LiteralControl and ObjectTag public class SilverlightTaskViewer : WebPart { protected override void CreateChildControls() { base.CreateChildControls(); string hostTag = @" "; // Put the Object Tag the control collection LiteralControl slObj = new LiteralControl(hostTag); Controls.Add(slObj); }
11
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Hosting in SharePoint (2) Browser Cache a Problem ▫ SPUtility.MakeBrowserCacheSafeLayoutsUrl() Can help but must be in a template to work
12
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Hosting in SharePoint (3) WebPart Can Create HTML Code ▫ Can Use Silverlight control and ScriptManager ▫ But why?
13
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Showing Silverlight in WebPart
14
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Using SharePoint Web Services Creating ServiceReferences to SP “Just Works” ▫ http:// /_vti_bin/Lists.asmx ▫ http:// /_vti_bin/Alerts.asmx ▫ Etc.
15
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Using SharePoint Web Services (2) Data Returned is Typically XML ▫ Must Use Projection to Shape for DataBinding XElement tasks = e.Results; var qry = from i in e.Result.Descendants(rowName) select new Task() { Title = i.Attribute("ows_Title").Value, Priority = i.Attribute("ows_Priority").Value, Status = i.Attribute("ows_Status").Value, }; theList.ItemsSource = qry.ToList();
16
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Consume a Web Service
17
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Debug Considerations Pain Points with Debugging the Silverlight Code ▫ Browser Cache Need Invalidated to Debug ▫ “Run with Debugging” Only Works Locally Remote Debugging Silverlight is not trivial Attach To Process Works Well ▫ Cross Domain May Be An Issue Too.
18
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Debugging Silverlight in WebPart
19
Copyright 2009 Wildermuth Consulting Services, LLC Silverlight in SharePoint WebParts – Atlanta SQL Saturday 2009 Questions? Links: ▫ My Blog (Code is Available Here) http://wildermuth.com ▫ My Email: shawn@agilitrain.com ▫ Silverlight.NET http://silverlight.net Shawn Wildermuth AgiliTrain Microsoft MVP (C#), MCSD
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.