1 / 13

Going for Gold w/Silverlight

Going for Gold w/Silverlight. using Silverlight in an Arena Module Nick Airdo Software Engineer Central Christian Church Email: nick.airdo@cccev.com Twitter: @airdo Tweet using #RefreshCache. Web Services.

abbott
Download Presentation

Going for Gold w/Silverlight

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. Going for Gold w/Silverlight using Silverlight in an Arena Module Nick Airdo Software Engineer Central Christian Church Email: nick.airdo@cccev.com Twitter: @airdo Tweet using #RefreshCache

  2. Web Services • Silverlight running on the client communicates with the server via Web Services • It is only allowed to communicate back to the host/site from which it came • Exception: if the site admin creates a cross-domain policy (crossdomain.xml or clientaccesspolicy.xml)

  3. Web Service Create a web service to consume if needed

  4. Silverlight Project Add a new Project (“Silverlight Application”) to your Arena solution:

  5. Add Service Reference Add the service reference to the Silverlight App

  6. Parts of the Silverlight App <UserControl x:Class="Arena.Custom.Cccev.Silverlight.PrayerVisualizer.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <UserControl.Resources> <Storyboard x:Name="Storyboard1"> <DoubleAnimation Storyboard.TargetName="txtTitle" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:1"BeginTime="0:0:4" AutoReverse="False" /> </Storyboard> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="Transparent"> <TextBlock x:Name="txtTitle" Margin="5" Height="20"TextAlignment="Center" Text="Prayer Visualizer 1.0" ></TextBlock> </Grid> </UserControl> • App.xaml • Good place to add style or template resources • Page.xaml • Your main UserControl

  7. Page.xaml.cs

  8. Silverlight Host Module • Download our Silverlight Host modulehttp://community.arenachms.com/files/folders/modules/entry5941.aspx • Generates required markup to embed your Silverlight application on a page

  9. Sample Markup <script type="text/javascript"> function onSilverlightError(sender, args) { . . . } </script> <div id="silverlightControlHost"> <object data="data:application/x-silverlight," type="application/x-silverlight-2" width='800' height='600'> <paramname="source" value='ClientBin/Arena.Custom.Cccev.Silverlight.PrayerVisualizer.xap'/> <paramname="onerror" value="onSilverlightError" /> <paramname="background" value="white" /> <paramname="InitParameters" value='' /> <a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"> <imgsrc="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object> <iframestyle='visibility:hidden;height:0;width:0;border:0px'></iframe> </div>

  10. JS Errors Be on the lookout for Check the ClientBin folder The xap file isMissing

  11. Project Properties Add a post-build event: copy "$(TargetDir)Arena.Custom.Cccev.Silverlight.PrayerVisualizer.xap" "C:\Arena Trunk\trunk\Arena\ClientBin"

  12. Live Demo

  13. References • Dallon Feldner’s Whitepaper • http://community.arenachms.com/files/folders/documents/entry2124.aspx • Accelerated Silverlight 2

More Related