Silverlight Pictures Bulletin Board official edition

Source: Internet
Author: User
Tags silverlight visual studio

A Silverlight Picture bulletin control was posted last week, only to achieve the initial effect. Take the time to complete it today and launch the official version.

The official version adds a toggle picture animation effect, reads the XML file no longer relies on the webservice, the digital button responds the function to revise. This time rewrite most of the code, Silverlight's structure has also made changes, and the program has been "slimming", perhaps careful people also found the last version, the implementation of the function is only very simple but the file has 300k, after "slimming" after the Silverlight program only 8k.

Make the tools you need

Visual Studio 2008

Microsoft Expression Blend 2.5 March 2008 Preview

I'm not making videos this time.

To read an XML file by using WebClient instead

Reading XML code

//建立读取xml文件的WebClient
WebClient xmlClient = new WebClient ();
xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xmlClient_DownloadStringCompleted);
xmlClient.DownloadStringAsync(new Uri(HtmlPage.Document.DocumentUri, "XML/Placard.xml"));

Let's look at what the XAML structure modifies.

Grid code in Placard.xaml file

<grid x:name= "LayoutRoot" background= "white" loaded= "placard_loaded" >
<image x:name= "Image" cursor= "Hand" width= "the" height= "195" opacitymask= "#FF000000"/>
<canvas x:name= "temp" margin= "0,0,0,0" width= "the" height= "195"/>
<stackpanel height= "x:name=" Foot "verticalalignment=" Bottom "orientation=" >
<rectangle height= "width=" 0 "x:name=" g_rect "fill=" #FF000000 ">
<Rectangle.OpacityMask>
<lineargradientbrush endpoint= "0.688000023365021,0.474000006914139" startpoint= " 0.0970000028610229,0.526000022888184 ">
<gradientstop color= "#00000000"/>
<gradientstop color= "#FF000000" offset= "1"/>
</LinearGradientBrush>
</Rectangle.OpacityMask>
</Rectangle>
<textblock height= "width=" text= "TextBlock" textwrapping= "Wrap" foreground= "#00000000" x:name= "Mouseindex" margin= " -70,0,0,0"/>
<textblock height= "x:name=" Currentindex "width=" "foreground=" #00000000 "text=" TextBlock "textwrapping=" Wrap "margin=" -110,0,0,0 "/>
</StackPanel>
<!--top for capturing mouse clicks-->
<rectangle horizontalalignment= "Stretch" margin= "0,0,0,0" verticalalignment= "Top" fill= "#00000000" width= "260" height= "178" x:name= "Top" cursor= "Hand" mouseenter= "Top_mouseenter" mouseleave= "Top_mouseleave" Top_mouseleftbuttonup "/>
</Grid>

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.