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>