Embed a simple Silverlight program on a SharePoint page

Source: Internet
Author: User

1. Open vs, new project Silverlight.

2. Name Mybannerad, OK.

3. Clear the option "Hosting Silverlight applications in a new Web site", OK.

4. Right-click the project Add folder images. Right-click images Add Existing items, add two pictures gear.png and branded.png.

5. Right-click the MainPage.xaml file and select View Designer. Edit code:

<usercontrol x:class= "Mybannerad.mainpage" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d= "http://schemas.microsoft.com/expression/blend/ 2008 "xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006 "mc:ignorable=" D "d:designheight=" 700 "D:designwidth=" > <grid x:name= "layoutroot" height= "M" width= "> <rectangle margin=" 66,42,152,20 "stroke=" #FF000000 "radiusx=" 0 "radiusy=" 0 "> <Rectangle.Fill> <lineargradientbrush x:name=" Mrgb "endpoint=" 0.5,1 "startpoint=" 0.5,0 "> <gradientstop color=" #FF000000 "offset=" 0 "/> <gradientstop Color= "#FF5E0805" offset= "0.478"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> < Image margin= "48,49,128,20" x:name= "Brandedimage" source= "Images/brand.png"/> <textblock x:Name= "
Titletextblock "margin=" 75,59,161,0 "fontfamily=" Arial "fontsize=" "fontweight=" Bold "textwrapping=" Wrap "Foreground= "#FFF9F4F4" textalignment= "Center" height= "verticalalignment=" "Top" text= "Life without Borders" >
</TextBlock> <textblock x:name= "Footertextblock" margin= "75,564,161,0" fontfamily= "Arial" fontsize= "16" fontweight= "Bold" textwrapping= "Wrap" foreground= "#FFF9F4F4" textalignment= "Center" height= "verticalalignment=" Top "text=" Fabrikam, Inc. > </TextBlock> <image margin= "121,559,216,14" x:name= "Gearimage" source= "Images/gear.png"/> </grid > </UserControl>

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/Silverlight/

6. Your Silverlight application should be like this:

7. Press the F5 test is normal.

8. Create a new document library in the SharePoint site Xaps, find the mybannerad.xap in the Silverlight application you created, and upload it.

9. Create a new Web Part Page in SharePoint Designer, and add Silverlight WebPart. Set properties.

10. Preview in Browser.

Author: csdn Blog Zhang Shihui

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.