<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mingfei's Code Block</title><link>http://blogs.msdn.com/b/mingfeis_code_block/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Building video application on Windows 8 – things you want to know</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/10/28/building-video-application-on-windows-8-things-you-want-to-know.aspx</link><pubDate>Sat, 27 Oct 2012 18:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10363344</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10363344</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/10/28/building-video-application-on-windows-8-things-you-want-to-know.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you want to build video applications on Windows 8 platform, you may find this blog useful.&amp;nbsp;We (&lt;a href="https://www.windowsazure.com/en-us/home/features/media-services/"&gt;Windows Azure Media Services&lt;/a&gt;&amp;nbsp;team) ships&amp;nbsp;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/04423d13-3b3e-4741-a01c-1ae29e84fea6"&gt;Smooth Streaming Client SDK for Windows 8&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://playerframework.codeplex.com/"&gt;Microsoft Media Platform Player&amp;nbsp;framework&lt;/a&gt;&amp;nbsp;(MMPPF) in addition to Windows 8 Media Foundation to help you build rich media applications.&lt;/p&gt;
&lt;h4&gt;&lt;span&gt;Building Video application on Windows 8 - what are&amp;nbsp;supported?&amp;nbsp;&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;If you are building a video&amp;nbsp;application on Windows 8 and your video source is H.264 (.MP4) for instance:&lt;img class="mceWPmore" title="More..." src="http://mingfeiy.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="Read More Here" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You could use&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.mediaelement"&gt;MediaElement&lt;/a&gt;&amp;nbsp;class in XAML application to handle the playback. Code sample:&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;MediaElement Source="Media/video1.mp4" AutoPlay="True" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Or you could use &amp;lt;video&amp;gt; tag in HTML5 application. Code sample:&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;video width="320" height="240" controls="controls"&amp;gt; &amp;lt;source src="movie.mp4" type="video/mp4"&amp;gt; &amp;lt;/video&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is a detail list of video format that Windows 8 playback pipeline support (&lt;a href="http://blogs.msdn.com/b/b8/archive/2012/06/08/building-a-rich-and-extensible-media-platform.aspx"&gt;full details in Windows blog&lt;/a&gt;) :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="http://mingfeiy.com/wp-content/uploads/2012/10/supported-video-format.png"&gt;&lt;img class="aligncenter  wp-image-1322" title="video format supported by Windows 8" src="http://mingfeiy.com/wp-content/uploads/2012/10/supported-video-format.png" alt="" width="554" height="232" style="display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That's what happen when developing an application with .Mp4 URL for instance. Windows 8 Media pipeline has Decorder to decode the video, Renderer to render&amp;nbsp;the image and Decrypter to decrypt the video if it is&amp;nbsp;protected. As long as the video format you provides falls into the category I showed in the table above, Windows 8 Media pipeline will handle for you. Meanwhile, Windows 8 team put in a lot of efforts for optimizing all these operations to achieve battery optimization,&amp;nbsp;hardware&amp;nbsp;acceleration and etc.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Playing Smooth Streaming content using Smooth Streaming Client SDK for Windows 8&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: #ffffff; color: #3366ff;"&gt;&lt;strong&gt;&lt;a href="http://mingfeiy.com/building-video-application-on-windows-8-all-you-need-to-know/"&gt;&lt;span style="background-color: #ffffff; color: #3366ff;"&gt;Read full blog here ..&lt;/span&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10363344" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure/">Windows Azure</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/windows+azure+media+service/">windows azure media service</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/windows+8/">windows 8</category></item><item><title>What is Windows Azure Media Services</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/28/what-is-windows-azure-media-services.aspx</link><pubDate>Mon, 27 Aug 2012 19:47:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10343930</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10343930</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/28/what-is-windows-azure-media-services.aspx#comments</comments><description>&lt;p&gt;I am a program manager currently working on&amp;nbsp;&lt;a href="https://www.windowsazure.com/en-us/home/features/media-services/"&gt;Windows Azure Media&amp;nbsp;Services&lt;/a&gt;(WAMS) team. This blog is my first tempt for trying to explain what WAMS is. We released Windows Azure Media Services Preview in June 2012. Currently we offer a&amp;nbsp;&lt;span&gt;90 days free trail&lt;/span&gt;&amp;nbsp;period for developers. If you are a Azure&amp;nbsp;subscriber, you have up to&amp;nbsp;&lt;span&gt;1 TB encoding&lt;/span&gt;&amp;nbsp;volume per month. And if you are on Azure 90 days free subscription plan, you will have up to&amp;nbsp;&lt;span&gt;20 GB data&lt;/span&gt;&amp;nbsp;in your storage account. You could check out this blog &amp;ndash;&amp;nbsp;&lt;a href="http://mingfeiy.com/getting-started-windows-azure-media-services/"&gt;how to sign up for Windows Azure Media Services&lt;/a&gt;.&lt;span id="more-1101"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;&lt;span&gt;What is Windows Azure Media Services&lt;/span&gt;&lt;/h4&gt;
&lt;div id="attachment_1102" class="wp-caption aligncenter"&gt;&lt;a href="http://mingfeiy.com/wp-content/uploads/2012/08/WAMS.png" class="fancybox" rel="gallery"&gt;&lt;img class="wp-image-1102 " title="Windows Azure Media Services" src="http://mingfeiy.com/wp-content/uploads/2012/08/WAMS.png" alt="" width="614" height="238" /&gt;&lt;/a&gt;
&lt;p class="wp-caption-text"&gt;Figure 1: Windows Azure Media Services&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Windows Azure Media Services offers a collection of components and technologies from Microsoft and third parties to enable end-to-end media solutions, leveraging on Windows Azure platform. If you are looking for end-to-end media solution with the power of cloud computing, Windows Azure Media Services is the right service you should consider.&lt;/p&gt;
&lt;p&gt;Read the full &lt;a href="http://mingfeiy.com/what-windows-azure-media-services/"&gt;article&lt;/a&gt;&amp;nbsp;here.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10343930" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure/">Windows Azure</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Cloud/">Cloud</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/HTMl5/">HTMl5</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Media/">Media</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Video/">Video</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure+media+services/">Windows Azure media services</category></item><item><title>Getting started with Windows Azure Media Services</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/20/getting-started-with-windows-azure-media-services.aspx</link><pubDate>Sun, 19 Aug 2012 23:49:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10341468</guid><dc:creator>Mingfei</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10341468</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/20/getting-started-with-windows-azure-media-services.aspx#comments</comments><description>&lt;p&gt;This blog shows you how to request for Windows Azure Media Services Preview and create an account through Windows Azure portal.&lt;/p&gt;
&lt;h4&gt;&lt;span&gt;Sign up for the preview&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;1. Go to&amp;nbsp;&lt;a href="http://windowsazure.com/"&gt;windowsazure.com&lt;/a&gt;&amp;nbsp;and obtain a free-trail account or login with your own account.&lt;/p&gt;
&lt;p&gt;2. Go to&amp;nbsp;&lt;a href="https://account.windowsazure.com/PreviewFeatures"&gt;https://account.windowsazure.com/PreviewFeatures&lt;/a&gt;&amp;nbsp;and that&amp;rsquo;s where you could request for feature preview.&amp;nbsp;&lt;span id="more-1012"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mingfeiy.com/wp-content/uploads/2012/07/ScreenShot235.jpg" class="fancybox" rel="gallery"&gt;&lt;img class="alignnone  wp-image-1013" title="Request Windows Azure Media Service" src="http://mingfeiy.com/wp-content/uploads/2012/07/ScreenShot235.jpg" alt="" width="577" height="238" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. Click on Try it now showed in the picture above. After clicking it, you will see the following screen. Currently we offer three-months free trail and you could click on complete if you want to give it a try.&lt;/p&gt;
&lt;p&gt;Continue reading &lt;a href="http://mingfeiy.com/getting-started-windows-azure-media-services/"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10341468" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure/">Windows Azure</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Cloud/">Cloud</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Smooth+Streaming/">Smooth Streaming</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure+media+services/">Windows Azure media services</category></item><item><title>Building Windows Store Apps with Smooth Streaming Client SDK Beta 2</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/15/building-windows-store-apps-with-smooth-streaming-client-sdk-beta-2.aspx</link><pubDate>Tue, 14 Aug 2012 19:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10339573</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10339573</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/08/15/building-windows-store-apps-with-smooth-streaming-client-sdk-beta-2.aspx#comments</comments><description>&lt;p&gt;Yesterday we announced the&amp;nbsp;&lt;a href="http://learn.iis.net/page.aspx/1279/smooth-streaming-client-sdk-beta-2-for-windows-store-apps-release-notes/"&gt;release&amp;nbsp;&lt;/a&gt;of Smooth Streaming Client SDK Beta 2 for Windows Store Apps.The Smooth Streaming Client SDK Beta&amp;nbsp;2 for Windows Store Apps enables developers to build Windows&amp;nbsp;Store applications that can play on-demand and live Smooth Streaming content with or without Microsoft PlayReady protection.&lt;/p&gt;
&lt;p&gt;This blog is a walk-through for building a &amp;ldquo;Hello World&amp;rdquo; version of Smooth Streaming Windows Store Apps, using JavaScript and HTML5. This sample application uses Smooth Streaming Client SDKs directly. But we also&amp;nbsp;recommend&amp;nbsp;you to take a look at&amp;nbsp;&lt;a href="http://playerframework.codeplex.com/wikipage?title=Player%20Framework%20for%20Windows%208%20Metro%20Style%20Apps&amp;amp;referringTitle=Home"&gt;Microsoft Media Platform Player Framework for Windows 8&lt;/a&gt;, which is a player framework built on top of client SDKs. It is very easy to use for you to build rich video applications. If you are using earlier version of Client SDK, you could refer to this&amp;nbsp;&lt;a href="http://blogs.iis.net/cenkd/archive/2012/03/28/How-to-build-your-first-html5-metro-style-smooth-streaming-player.aspx"&gt;blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Continue reading &lt;a href="http://mingfeiy.com/building-windows-store-apps-smooth-streaming-client-sdk-beta-2/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10339573" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Smooth+Streaming/">Smooth Streaming</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Media/">Media</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/windows+azure+media+service/">windows azure media service</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Video/">Video</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/ssme/">ssme</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/wams/">wams</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/windows+8/">windows 8</category></item><item><title>Smooth Streaming Client v2.0 walkthrough: How to figure out when data chunk failed to be downloaded</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/06/04/smooth-streaming-client-v2-0-walkthrough-chunkdownloadfailed.aspx</link><pubDate>Sun, 03 Jun 2012 23:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10314476</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10314476</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/06/04/smooth-streaming-client-v2-0-walkthrough-chunkdownloadfailed.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;This blog belongs to a series of Smooth Streaming Client v2.0 walkthroughs. You could download this latest Smooth Streaming Client SDks &lt;a href="http://www.iis.net/download/SmoothClient"&gt;here&lt;/a&gt;. We have made a few major changes in this version. In this blog, I will introduce to you how to figure out data chunk information while you are downloading it.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;While playing smooth streaming content, you could utilize ChunkDownloadedEventArgs to figure out downloaded chunk information, such as whether data chunk is successfully downloaded, what type of data chunk is, what duration the chunk has and etc. This is very useful for you to monitor data chunk download progress. If you find something wrong, you don&amp;rsquo;t have to wait the downloader to keep retrying, rather you could route to other media source for instance.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;Here is all the information you could get from ChunkDownloadedEventArgs:&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-size: small;"&gt;&lt;code class="csharp"&gt; public class ChunkDownloadedEventArgs : EventArgs&lt;br /&gt; {&lt;br /&gt; public Uri CanonicalUri { get; }&lt;br /&gt; public ChunkInfo Chunk { get; }&lt;br /&gt; public ChunkResult.ChunkResultState DownloadResult { get; }&lt;br /&gt; public ChunkRequestType RequestType { get; }&lt;br /&gt; public HttpStatusCode StatusCode { get; }&lt;br /&gt; public TrackInfo Track { get; }&lt;br /&gt; }&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;You could refer to the table below for more information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/4130.ScreenShot128.jpg"&gt;&lt;img border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x248/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/4130.ScreenShot128.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;The way to implement ChunkDownloadedEventArgs is quite straight forward. Firstly, we need to hook up ChunkDownloadedEventArgs with smooth streaming player.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="csharp"&gt;SmoothPlayer.ChunkDownloadFailed += new EventHandler&amp;lt;ChunkDownloadedEventArgs&amp;gt;(SSME_ChunkDownloadFailed);&lt;/code&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: trebuchet ms,geneva; font-size: small;"&gt;Here I implement a method to read out all the useful information from the event args.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-size: small;"&gt;&lt;code class="csharp"&gt; private void SSME_ChunkDownloadFailed(object sender, ChunkDownloadedEventArgs args)&lt;br /&gt; {&lt;br /&gt; {&lt;br /&gt; statusTxt.Text = "The actual request type is " + args.RequestType+"\n";&lt;br /&gt; if (args.Chunk != null)&lt;br /&gt; {&lt;br /&gt; statusTxt.Text += "chunk is not null"+"\n";&lt;br /&gt; statusTxt.Text += "chunk duration is " + args.Chunk.Duration + "\n";&lt;br /&gt; statusTxt.Text+="chunk time stamp is "+args.Chunk.TimeStamp+"\n";&lt;br /&gt; statusTxt.Text += "chunk stream is " + args.Chunk.Stream + "\n";&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (args.Chunk.Stream != null)&lt;br /&gt; {&lt;br /&gt; statusTxt.Text += "chunk's stream is not null"+"\n";&lt;br /&gt; }&lt;br /&gt; statusTxt.Text+="This chunk is "+ args.Chunk.Stream.Type+"\n";&lt;br /&gt; if (args.Track != null)&lt;br /&gt; {&lt;br /&gt; statusTxt.Text += "track is not null"+"\n";&lt;br /&gt; }&lt;br /&gt; statusTxt.Text+="The result is "+ args.DownloadResult+"\n";&lt;br /&gt; statusTxt.Text += "The result is " + args.StatusCode+"\n";&lt;br /&gt; };&lt;br /&gt; }&lt;br /&gt; &lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10314476" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Media/">Media</category></item><item><title>Assign media url in code behind for SmoothStreamingMediaElement</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/05/11/assign-media-url-in-code-behind-for-smoothstreamingmediaelement.aspx</link><pubDate>Fri, 11 May 2012 01:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10304057</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10304057</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/05/11/assign-media-url-in-code-behind-for-smoothstreamingmediaelement.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;In this short blog, I will talk about how to assign media url in code behind for SSME: SmoothStreamingMediaElement. For this code sample, I am not using&amp;nbsp;Microsoft Media Platform: &lt;a href="http://smf.codeplex.com/"&gt;Player Framework v2.6&lt;/a&gt;. I am building the application from scratch using &lt;a href="http://www.iis.net/download/SmoothClient"&gt;Silverlight Smooth Streaming Client v1.5&lt;/a&gt;. I hope this short blog will help you while debugging.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;1. You will need to add the player in .xaml file. I didn't set the streaming source in SmoothStreamingMediaElement in .xaml file. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-size: small;"&gt;&lt;code class="html"&gt;&amp;lt;SSME:SmoothStreamingMediaElement AutoPlay="false" x:Name="SmoothPlayer" Grid.Row="0" /&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;2. And go to the code behind, and insert the following code&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-size: small;"&gt;&lt;code class="csharp"&gt; public MainPage()&lt;br /&gt; {&lt;br /&gt; InitializeComponent();&lt;br /&gt; &lt;br /&gt; SmoothPlayer.SmoothStreamingSource = new Uri("http://devplatem.vo.msecnd.net/Sintel/Sintel_VC1.ism/manifest");&lt;br /&gt; &lt;br /&gt; SmoothPlayer.MediaOpened += (o, e) =&amp;gt;&lt;br /&gt; {&lt;br /&gt; SmoothPlayer.Play();&lt;br /&gt; };&lt;br /&gt; }&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;You will see from the code above, the first step is straight-forward, that we assign the media source URI to SmoothStreamingSource. However, if now, you immediately call SmoothPlayer.Play(), you will get an error. That's because when media source gets set up, Smooth Streaming player will do a bunch of things, such as downloading manifest and downloading some amount of data chunks. Thus, initially I called SmoothPlayer.Play() after ManifestReady() event, that's also wrong. Because Smooth Streaming player still needs to validate the media stream and read the file reader. However, MediaOpened event&amp;nbsp;guaranteed&amp;nbsp;all these. For details, you could read on MediaOpened() MSDN documentations &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.smoothstreamingmediaelement.mediaopened(v=vs.90).aspx"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;In addition, if you want to read more about how we design different state of the media elements, you could read MSDN documents &lt;a href="http://msdn.microsoft.com/en-us/library/ff728115(v=VS.90).aspx"&gt;Media Element State Transitions&lt;/a&gt;. &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10304057" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Media/">Media</category></item><item><title>Smooth Streaming Cache Plug-in implementation</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/10/smooth-streaming-cache-plug-in-implementation.aspx</link><pubDate>Mon, 09 Apr 2012 23:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292056</guid><dc:creator>Mingfei</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10292056</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/10/smooth-streaming-cache-plug-in-implementation.aspx#comments</comments><description>&lt;p&gt;&lt;span face="'trebuchet ms', geneva" size="3" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;When you implement a video player, it is good to use cache to store played video fragments. Therefore, user doesn't need to download manifest or data chunks&amp;nbsp;from server multiple times. It saves network consumption for your users and reduce the latency since they don't need to download from server all the time. Meanwhile, using cache reduces server load for content provider as well. If you use&lt;a href="http://www.iis.net/download/SmoothClient" target="_blank"&gt; Smooth Streaming Client&lt;/a&gt;, here is how you could implement a cache plug-in to cache data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span face="'trebuchet ms', geneva" size="3" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;The IIS Smooth Streaming Client provides the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.ismoothstreamingcache(v=vs.90).aspx" target="_blank"&gt;ISmoothStreamingCache &lt;/a&gt;interface to support offline scenarios. Here is how it works in high level.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;span face="'trebuchet ms', geneva" size="3"&gt;When user starts to play video, Silverlight Smooth Streaming Client will check with Isolated Storage Instance (this isolated storage is within Silverlight player) to see whether there is video manifest or data chunks&amp;nbsp;available to read. If not, Isolated Storage Instance will return a NULL as CacheResponse. Now, client knows there is no cache available for retrieving, then, it will go ahead to talk to server for getting manifest/data chunks, and stored it in the cache for next-time use&lt;/span&gt;. Here is a high level diagram for this conversation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2526.Cache.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2526.Cache.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Second time, since we have saved data into cache (isolated storage), when client check with cache using BeginRetrieve(), cache will give back the data in EndRetrieve(). Client won't need to make a request to server in this case.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0523.cache2.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0523.cache2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Here is a detailed documentation on how to &lt;a href="http://msdn.microsoft.com/en-us/library/gg296362(v=vs.90).aspx"&gt;implement Cache Plugin-in&lt;/a&gt; on MSDN.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;I did a simplified version for demo purpose and you could download it &lt;a href="https://skydrive.live.com/redir.aspx?cid=dda82aac0ac4fe4d&amp;amp;resid=DDA82AAC0AC4FE4D!1086&amp;amp;parid=DDA82AAC0AC4FE4D!1084"&gt;here&lt;/a&gt;. And let's explain the code in steps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;0. This project is based on &lt;/span&gt;&lt;a href="http://www.iis.net/download/SmoothClient" target="_blank" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Smooth Streaming Client &lt;/a&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;1.5. For setting up instruction, please refer to my another &lt;/span&gt;&lt;a href="http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/01/getting-started-for-building-a-smooth-streaming-client.aspx" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;blog post&lt;/a&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;1. In MainPage.xaml, a smooth streaming player is created:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;code class="html"&gt; &amp;lt;SSME:SmoothStreamingMediaElement AutoPlay="false" x:Name="SmoothPlayer" SmoothStreamingSource="http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest" Grid.Row="0" /&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;2. And in MainPage.xaml, there are only "Play" button, "Stop" button and "Clear Cache" button. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;3. Open MainPage.xaml.cs, and here are all the methods listed in this file. (Click to view a larger image)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2350.ScreenShot013.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2350.ScreenShot013.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;4. If you open SmoothPlayer_Loaded(obejct sender, RoutedEventArgs e) method, you will see:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;code class="csharp"&gt; void SmoothPlayer_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt; {&lt;br /&gt; cache = new ISO_StorageCache();&lt;br /&gt; SmoothPlayer.SmoothStreamingCache = cache;&lt;br /&gt; }&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Basically, when ISO_StorageCache getting initialized, we will create a Isolated Storage file for storing manifest and data chunks. The URL/file name pairs stored in the IsolatedStorageSettings.ApplicationSettings object are read into a dictionary object when the cache is instantiated, and the dictionary pairs are used to identify data files in the cache. Here is the code:&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;code class="csharp"&gt; public ISO_StorageCache()&lt;br /&gt; {&lt;br /&gt; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;IsolatedStorageFile isoFileArea = IsolatedStorageFile.GetUserStoreForApplication();&lt;br /&gt; &lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;foreach (System.Collections.Generic.KeyValuePair&amp;lt;string, object&amp;gt; pair in IsolatedStorageSettings.ApplicationSettings)&lt;br /&gt; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; if (!keyUrls.ContainsValue((string)pair.Value) &amp;amp;&amp;amp; isoFileArea.FileExists((string)pair.Value))&lt;br /&gt; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; KeyUrls.Add(pair.Key, ((string)pair.Value));&lt;br /&gt; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;br /&gt; }&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;5. Still looking at SmoothPlayer_Loaded method, "SmoothPlayer.SmoothStreamingCache=cahe". In this line,an ISmoothStreamingCache object is started and a request for data is issued, the Silverlight Smooth Streaming Client will call each of the methods in the order: BeginRetrieve, EndRetrieve, BeginPersist, EndPersist as showed above. And I have explained the use of these four methods at the beginning.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;6. At the end, if you want to modify the result(manifest or data chunks) before going into cache, you could catch the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.cacheresponse(v=vs.90).aspx"&gt;CacheResponse&lt;/a&gt; before it is saved into Isolated Storage file in EndPersist() method. CacheResponse will give you information for your content type, a response(manifest or data chunks) in stream format and header.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;7. I often hit the problem that isoFile size is not enough and you could increase isoFile's size in EndPersist() by adding the following line. Or you could press the clean cache button.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;code class="csharp"&gt; /*Increase ISOFileArea size*/&lt;br /&gt; long availbleCacheBytes = isoFileArea.AvailableFreeSpace;&lt;br /&gt; long saveQuotaNumber = isoFileArea.Quota;&lt;br /&gt; &lt;br /&gt; isoFileArea.IncreaseQuotaTo(isoFileArea.Quota + 1048576);&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10292056" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Media/">Media</category></item><item><title>Getting Started for building a smooth streaming client</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/01/getting-started-for-building-a-smooth-streaming-client.aspx</link><pubDate>Sat, 31 Mar 2012 19:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10289662</guid><dc:creator>Mingfei</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10289662</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/01/getting-started-for-building-a-smooth-streaming-client.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;There are two types of developments for building a Smooth Streaming Client:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;strong&gt;&lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/IIS Smooth Streaming Client 1.5 APIs" title="http://msdn.microsoft.com/en-us/library/ee958035(v=VS.90).aspx" target="_blank"&gt;IIS Smooth Streaming Client 1.5 APIs&lt;/a&gt;&lt;/strong&gt;&amp;nbsp;: developers could utilize these APIs to build applications on Silverlight platform (runs on desktop,Xbox or Windows phone). These APIs is formally known as "Smooth Streaming Player Development Kit&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;strong&gt;Microsoft Media Platform - &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Player Framework v2.6" title="http://smf.codeplex.com/" target="_blank"&gt;Player Framework v2.6&lt;/a&gt;&lt;/strong&gt; : a open source framework. It includes sample player and numbers of plugins for developers to get quick started. And MMPPF is based on IIS Smooth Streaming Client APIs.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;This blog is for developers who want to build media player based on IIS Smooth Streaming Client APIs, instead of utilizing the framework.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Pre-request:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Install Smooth Streaming APIs:&amp;nbsp;&lt;a href="http://www.iis.net/download/SmoothClient"&gt;http://www.iis.net/download/SmoothClient&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Install Silverlight Development Runtime:&amp;nbsp;&lt;a href="http://www.silverlight.net/downloads"&gt;http://www.silverlight.net/downloads&lt;/a&gt;&amp;nbsp;I installed Silverlight 5 Tool for Visual Studio 2010 SP&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Now we will build a &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Smooth Streaming" title="http://www.iis.net/download/SmoothStreaming" target="_blank"&gt;Smooth Streaming&lt;/a&gt; Client step by step:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;1. Open Visual Studio. Select New Project... and Select Siverlight Application under Visual C# section. I choose PlayerDemo1 as the project name.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;2. Choose Host the Silverlight application in a new Web site.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt; &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x350/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp"&gt;&lt;/a&gt;3. &amp;nbsp;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Now you could see two projects are generated in Solution Explorer. PlayDemo1 is the Silverlight application with XAML files. And PlayerDemo1.Web is a web application project with HTML page, which &amp;nbsp; contain the Silverlight component you built in PlayerDemo1. If you build this application now, you will see a PlayerDemo1.xap get generated in ClientBin under PlayerDemo1.Web project.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2870.ScreenShot004.bmp"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x200/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2870.ScreenShot004.bmp" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;4. Right click on References fold under PlayerDemo1 project, choose Add Reference...&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x150/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;5. When you install Smooth Streaming APIs, the APIs are resided at /%SystemDrive%/Program Files(x86)/Microsoft SDKs/IIS Smooth Streaming Client/v1.5/Silverlight. And choose&amp;nbsp;Microsoft.Web.Media.SmoothStreaming.dll.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;6. Add namespace in MainPage.xaml under PlayerDemo1 project. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: x-small;"&gt;&lt;span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: x-small;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre class="scroll"&gt;&lt;code class="csharp"&gt;xmlns:SSME="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming" &lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;7. Add XAML for the media player and the whole MainPage.xaml should look like this:&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;
&lt;pre class="scroll"&gt;&lt;code class="csharp"&gt;&amp;lt;UserControl x:Class="PlayerDemo1.MainPage"&lt;br /&gt; xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt; xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt; xmlns:d="http://schemas.microsoft.com/expression/blend/2008"&lt;br /&gt; xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;br /&gt; xmlns:SSME="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming" &lt;br /&gt; mc:Ignorable="d"&lt;br /&gt; d:DesignHeight="640" d:DesignWidth="480"&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;Grid x:Name="LayoutRoot"&amp;gt;&lt;br /&gt; &amp;lt;SSME:SmoothStreamingMediaElement AutoPlay="True" x:Name="SmoothPlayer" SmoothStreamingSource="http://streams.smooth.vertigo.com/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest" Grid.Row="0" /&amp;gt;&lt;br /&gt; &amp;lt;/Grid&amp;gt;&lt;br /&gt; &amp;lt;/UserControl&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;8. Lastly, press F5 and you will compile the project and see a simple smooth streaming client.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="padding-left: 30px;"&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7506.ScreenShot007.bmp"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7506.ScreenShot007.bmp" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Some useful links: &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;&lt;span face="'trebuchet ms', geneva" size="2"&gt;Smooth Streaming Deployment &lt;/span&gt;&lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Guide" title="http://www.microsoft.com/download/en/details.aspx?id=2547" target="_blank" style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;Guide&lt;/a&gt;&lt;span face="'trebuchet ms', geneva" size="2"&gt;&amp;nbsp;(Comprehensive&amp;nbsp;and useful): prepare your own media source, config Smooth Streaming Server and deploy media onto your server&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;IIS Smooth Streaming HD Sample &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Guide" title="http://www.microsoft.com/download/en/details.aspx?id=18199" target="_blank"&gt;Guide&lt;/a&gt;: it provides two media sources in streaming format so you don't need to use Encoder to prepare your media&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva; font-size: small;"&gt;[&lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Blog" title="http://learn.iis.net/page.aspx/558/getting-started-with-iis-smooth-streaming" target="_blank"&gt;Blog&lt;/a&gt;]Getting started with IIS Smooth Streaming: Step by Step showing you how to set up a sample Smooth Streaming&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10289662" width="1" height="1"&gt;</description></item><item><title>Testing Tools for web API</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/07/30/testing-tools-for-web-api.aspx</link><pubDate>Sat, 30 Jul 2011 10:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10191378</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10191378</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/07/30/testing-tools-for-web-api.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Web API&amp;rsquo;s have long been used to allow programmers access to functionality via a well defined interface without the need to understand exactly how that functionality is implemented.&amp;nbsp;I was using Hurl and fiddler recently for Web API testing and I hope it is helpful for Web Api developers as well as consumers to test out the services.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Hurl: you can download at&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;a href="http://hurl.it/"&gt;http://hurl.it/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1106.ScreenShot787.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Hurl is a Web-based tool for testing APIs. You could choose the request method, customize headers and POST parameters, add basic authorization, and follow redirects. Then view the nicely formatted request and response. It is a very clean and easy tool for testing your APIs.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6165.ScreenShot789.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6165.ScreenShot789.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Here is the Twitter API reference page I used: &lt;a href="https://dev.twitter.com/docs/api/1/get/search"&gt;https://dev.twitter.com/docs/api/1/get/search&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;HURL provides five HTTP methods: PUT, GET, POST, DELTE, and HEAD. And you could apply HTTP basic access authentication. You could also view request and response body in full size view (a pop up window). Another thing I like Hurl is that for response body, it highlights the contents with different colors, which made it really easy to read.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;You could also login and after that, you could view your call history:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0118.ScreenShot791.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0118.ScreenShot791.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;By clicking on each URL you will be redirected back to request page with parameters you used previously. And you could repeat the test again or modify on the past test.&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Fiddler: you can download at&amp;nbsp;&lt;a href="http://www.fiddler2.com/fiddler2/"&gt;http://www.fiddler2.com/fiddler2/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Fiddler is a free Web Debugging Proxy which logs all&amp;nbsp;&lt;/span&gt;&lt;nobr&gt;HTTP(S)&lt;/nobr&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&amp;nbsp;traffic between your computer and the Internet. It is a desktop application only runs on Windows Operating System.&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8688.ScreenShot786.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8688.ScreenShot786.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;There are two parts of Fiddler you may be interested in immediately. Firstly, it is the request builder showed above. You could customize your request. It has almost all types of HTTP methods supported. By pressing the Execute button you will see the response return.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Secondly, it is the Session Inspector. By clicking on the web sessions history on the left side, you could inspect each session individually with details showed up on Inspectors.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8863.ScreenShot792.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8863.ScreenShot792.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Another interesting feature for Fiddler is that it provides Web View, so you could see images that are returned. &amp;nbsp;This allows you to see specifically what was returned to the browser before it was interpreted.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1325.ScreenShot793.jpg"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1325.ScreenShot793.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'trebuchet ms', geneva;"&gt;Fiddler is a very powerful tool has much more functions than I introduced. You could refer to Fiddler help document for more information. &lt;a href="http://www.fiddler2.com/Fiddler/help/"&gt;http://www.fiddler2.com/Fiddler/help/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191378" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Rest/">Rest</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Web+APi/">Web APi</category></item><item><title>Power of HTML5 Audio Tag – With IE9, Chrome, Safari, Wp7, iPhone, iPad</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/05/26/power-of-html5-audio-tag-with-ie9-chrome-safari-wp7-iphone-ipad.aspx</link><pubDate>Thu, 26 May 2011 14:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10168664</guid><dc:creator>Mingfei</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10168664</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/05/26/power-of-html5-audio-tag-with-ie9-chrome-safari-wp7-iphone-ipad.aspx#comments</comments><description>&lt;p&gt;I tried HTML5 Audio Tag myself and simply amazed by how easy this can be implemented. Meanwhile, because it is native to the browser, it works fine on most of browsers (I tired FireFox, IE9, Safari and Chrome) and most of devices (Mango version of Windows Phone, iPhone and iPad). This is my toy site: &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/mbox.cloudapp.net"&gt;mbox.cloudapp.net&lt;/a&gt;. I may not host it long hence I have printscreen for all the scnarios below, so you could see how Audio Tag rendered in different end devices.&lt;/p&gt;
&lt;p&gt;Currently, HTML5 audio element has five attributes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;autoplay: Specifies that the audio should start playing as soon as it is ready.&lt;/li&gt;
&lt;li&gt;controls: Specifies that playback controls should be displayed.&lt;/li&gt;
&lt;li&gt;loop: Specifies that the audio should start over again, when it is finished.&lt;/li&gt;
&lt;li&gt;preload: Specifies whether or not the audio should be loaded when the page loads.&lt;/li&gt;
&lt;li&gt;src: Specifies the URL of the audio to play.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is how to implement HTML5 video tag with one single line of code.&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="html"&gt; &amp;lt;audio id="player" src="YOUR_SOURCE_HERE" controls="controls" autoplay&amp;gt;&amp;lt;/audio&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you can see the UI rendered like this in IE9. It shows a +30s and -30s when you mouse over the timer on both side. Also, current time and time for the whole song&amp;nbsp;will be displayed as well. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot681-600x47.jpg"&gt;&lt;img style="max-height: 300px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot681-600x47.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Same Audio tag rendered like this in Chrome 11. It doesn&amp;rsquo;t show much as IE9, such as overall timing and 30s fast-forward/fast-backward.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot682-600x32.jpg"&gt;&lt;img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot682-600x32.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is how Audio Tag looks like on Safari 5. There is no current time and total time. However, you can drop to next song/previous song.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot683-600x24.jpg"&gt;&lt;img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot683-600x24.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tired Opera 11 as well. It rendered in the browser but it doesn&amp;rsquo;t play.Same thing happend to Firefox 4 Beta. Later on i found out it was because they don't support the audio format .Mp3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot684-600x29.jpg"&gt;&lt;img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot684-600x29.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I further tested Audio tag on iPhone 4.3 and iPad 4.3.3. It rendered as below. Moreover, when you minimize browser, music will still continue in the background. Double tab you could open the multi-task bar at the bottom of screen, swap right, you could see the native audio player control. I truly like this kind of native integration with HTML5 tag.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7028.photo-_2800_3_2900_.PNG"&gt;&lt;img border="0" src="http://blogs.msdn.com/resized-image.ashx/__size/550x400/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7028.photo-_2800_3_2900_.PNG" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-2.png"&gt;&lt;img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-2.png" border="0" style="max-height: 300px; max-width: 550px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-1-600x450.png"&gt;&lt;img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-1-600x450.png" border="0" style="max-height: 300px; max-width: 550px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-4-600x147.png"&gt;&lt;img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-4-600x147.png" border="0" style="max-height: 300px; max-width: 550px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tested Andiord phone as well, both 2.3 and 2.2 version. The Audio bar doesn&amp;rsquo;t get loaded. Current Windows Phone 7 doesn&amp;rsquo;t support Audio tag. However, since IE9 will be shipped with next version of Windows Phone 7, obviously, audio tag will be native to Windows Phone 7 browser in the near future as well.&lt;/p&gt;
&lt;p&gt;I had a problem with starting a song with a specific timing, such as starting a song from 20 seconds (streaming). Because the song may not be loaded till that point, so if you jump to that point, it will have javascript error. Here is a way to solve it. And you can definitely improve it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="html"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;
    function timeMsg(startime) {&lt;br /&gt;
        var t = setTimeout("a("+startime+")", 5000);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function a(startime) {&lt;br /&gt;
        $("#player")[0].play();&lt;br /&gt;
        $("#player")[0].currentTime = startime;&lt;br /&gt;
    }&lt;br /&gt;
    function song_onClick(item) {&lt;br /&gt;
        var startTime = item.id;&lt;br /&gt;
        var songSrc = item.title;&lt;br /&gt;
        alert(songSrc + startTime);&lt;br /&gt;
        $("#player")[0].pause();&lt;br /&gt;
        $("#player")[0].src = songSrc;&lt;br /&gt;
        $("#player")[0].load();&lt;br /&gt;
        timeMsg(startTime);&lt;br /&gt;
     }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
 &amp;lt;audio id="player" src="YOUR_SOURCE_HERE" controls="controls" autoplay&amp;gt;&amp;lt;/audio&amp;gt;&lt;br /&gt;
    &amp;lt;div class="song" title="YOUR_SOURCE_HERE" id="20" onclick="song_onClick(this)"&amp;gt;&lt;br /&gt;
        Maid with the Flaxen Hair&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;             &lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can see from the code, the ID of the audio element is player.&lt;/p&gt;
&lt;p&gt;$(&amp;ldquo;#player&amp;rdquo;)[0].src = songSrc; is used to change the song src. So that we can change to the next song.&lt;/p&gt;
&lt;p&gt;However, here is&amp;nbsp;the track. If you wanted to start a song from some random point, you have to load the song first (if the song is streamed). Hence, I used setTimeOut method here to delay playing the song for 5 sec and I started play the song from 20 seconds. However, still, if you start more than 20 seconds, 5 seconds may not be long enough. You could design it to times a multiplier.&lt;/p&gt;
&lt;p&gt;Hope this post will inspire you to try out your audio application in HTML5, so you could benefit from one code base works for most of browsers and devices!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10168664" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/HTMl5/">HTMl5</category></item><item><title>Microsoft cloud day in Singapore</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/05/26/microsoft-cloud-day-in-singapore.aspx</link><pubDate>Thu, 26 May 2011 13:49:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10168656</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10168656</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2011/05/26/microsoft-cloud-day-in-singapore.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2010/03/CloudDay-Banner.jpg"&gt;&lt;img style="max-height: 300px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2010/03/CloudDay-Banner.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Microsoft Cloud Day was held on April 27th 2011 with 170 attendees representing 130 companies. It was a full day event with the aim of updating our community on Windows Azure Platform. We had extensively covered a mix of business and technical contents, from introducing the importance of cloud computing to deploying and monitoring Windows Azure application on the cloud.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photos_s-600x359.jpg"&gt;&lt;img style="max-height: 200px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/photos_s-600x359.jpg" /&gt;&lt;/a&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/post_S-600x375.jpg"&gt;&lt;img style="max-height: 200px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/post_S-600x375.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Highlights of the event includes the participation of Windows Azure AppFabric product team sharing the roadmap which was beneficial to our customers. We had excellent speakers from our SI Partner aZaaS, NCS and we also invited our customer Yolk for showcasing its Azure solution. All training partner booths (aZaaS, NCS and NetAsset) showcasing MS learning and cloud courses were well received.&lt;/p&gt;
&lt;p&gt;We also like to take this opportunity to thank all who attended the event and all who have helped one way or another in making Cloud Day a success. We hope to see you again!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/post1_s-600x375.jpg"&gt;&lt;img style="max-height: 200px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/post1_s-600x375.jpg" /&gt;&lt;/a&gt;&lt;a href="http://innovativesingapore.com/wp-content/uploads/2011/05/post2_S1-600x375.jpg"&gt;&lt;img style="max-height: 200px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/post2_S1-600x375.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s are the slides link and video on Channel 9:&lt;/p&gt;
&lt;div id="__ss_7828847"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/ms-cloud-day-keynote"&gt;Keynote&lt;/a&gt;&amp;nbsp;by DPE Director Ziriad Saibi&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Opening-Keynote/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/ms-cloud-day-introduction-to-windows-azure-platform-and-real-world-case-study"&gt;Introduction to Windows Azure platform and real world case study&lt;/a&gt;&amp;nbsp;by Azure Platform Strategy Advisor Daniel Bucherer&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Introduction-to-Windows-Azure-platform-and-real-world-case-study/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/ms-cloud-day-building-web-applications-with-azure-storage"&gt;Building web applications with Azure storage&lt;/a&gt;&amp;nbsp;by Lead Consultant, NCS, K.Mohamed Faizal&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Building-web-applications-with-Azure-Storage/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;li&gt;&lt;strong&gt;Understanding and implementing Windows Azure Platform Security by Tan Choon Ngee, Directo, aZaas Pte Ltd.&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Understanding-and-implementation-Windows-Azure-platform-security/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;li&gt;&lt;strong&gt;Windows Azure AppFabric, Comprehensive cloud Middleware platform by Product Unit Manager, Alex Chan&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Windows-Azure-AppFabric-Comprehensive-Cloud-Middleware-Platform/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/cloud-day-cloud-computing-a-crash-course-for-architects"&gt;Cloud Computing &amp;ndash; A Crash Course for Architects&lt;/a&gt;&amp;nbsp;by DPE Platform Strategy Advisor, Darryl Chantry&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Cloud-Computing--A-Crash-Course-for-Architects/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/cloud-day-deploying-and-monitoring-windows-azure-applications"&gt;Deploying and monitoring windows azure applications&lt;/a&gt;&amp;nbsp; by Wely Lau, Windows Azure MVP, NCS&amp;nbsp;&lt;/strong&gt;&lt;/li&gt;
&lt;iframe style="height: 288px; width: 512px;" src="http://channel9.msdn.com/posts/Microsoft-Cloud-Day-in-Singapore-Deploying-and-Monitoring-Windows-Azure-Application/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.slideshare.net/innovativesg/ms-cloud-day-closing-harish"&gt;Closing Note&lt;/a&gt;&amp;nbsp;by Harish Aitharaju, Server &amp;amp; Tool business lead, Microsoft Singaproe&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10168656" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Cloud/">Cloud</category></item><item><title>Windows Phone 7 : Style it using Expression Blend</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/windows-phone-7-style-it-using-expression-blend.aspx</link><pubDate>Sun, 03 Oct 2010 10:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070791</guid><dc:creator>Mingfei</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10070791</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/windows-phone-7-style-it-using-expression-blend.aspx#comments</comments><description>&lt;p&gt;Expression Blend 4 for Windows Phone provides the same streamlined development workflow for Windows Phone 7 that was previously only available for Silverlight and .NET applications. The ability to take your ideas all the way from concept to completion helps accelerate the delivery of innovative applications on Windows Phone. You can download Expression Blend 4 for Windows Phone Beta &lt;a href="https://www.microsoft.com/expression/windowsphone/Default.aspx"&gt;here&lt;/a&gt;.
Now I will introduce some simple but useful tips for utilizing Expression Blend 4 for your Windows Phone Application.
	&lt;/p&gt;
&lt;ul&gt;&lt;li style="padding-left: 30px;"&gt;Style your page element by using Expression Blend&lt;/li&gt;
&lt;li style="padding-left: 30px;"&gt;Add Visual States to a Control&lt;/li&gt;
&lt;li style="padding-left: 30px;"&gt;Make an image button and create pressed effect&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;
Firstly, using Expression Blend 4 to style your page element. For example, style your page title.&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is default style of application title in MainPage.xaml when you initiate a new project. Here &lt;em&gt;PhoneTextNormalStyle&lt;/em&gt; is applied to application title. Now we will create a new style by using Expression Blend.
&lt;/p&gt;
&lt;p&gt;
1. Right click on MainPage.xaml and select open in Expression Blend...
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step1-2/" rel="attachment wp-att-1498"&gt;&lt;img height="218" width="202" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step11-600x649.png" title="Open In Expression Blend" class="size-large wp-image-1498    aligncenter" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;
2. In Expression Blend, choose MY APPLICATION first and you will see a blue color box&amp;nbsp;surrounded this title and it indicates that this object has been selected. Right Click on MY APPLICATION and choose &lt;em&gt;Edit Style -&amp;gt; Create Empty...&lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;em&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step2/" rel="attachment wp-att-1501"&gt;&lt;img height="200" width="360" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step2-600x334.png" title="Edit Style" class="size-large wp-image-1501  aligncenter" /&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;3. You will see a&amp;nbsp;dialog&amp;nbsp;appear and key in a name you would like to use for your style. And I named it "MyTitleStyle". The dialog is showed as below:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step3/" rel="attachment wp-att-1502"&gt;&lt;img height="187" width="360" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step3-600x312.png" title="Create New Style" class="size-large wp-image-1502  aligncenter" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;4. Choose different color scheme or font size from Properties windows. Besides the normal color&amp;nbsp;palette, &amp;nbsp;there is also a Color resources introduced here which provides colors from phone theme, as showed in the screenshot below.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step4-2/" rel="attachment wp-att-1504"&gt;&lt;img height="250" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step41-600x250.png" title="Edit Style" class="aligncenter size-large wp-image-1504" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;5. After editing the style, close your Expression Blend and open Visual Studio. It will ask you "This file has been modified outside of the source editor. Do you want to reload it?". Click on "Yes to All".&lt;/p&gt;
&lt;p style="text-align: left;"&gt;6. Open MainPage.xaml. And you will see your ApplicationTitle line has been modified as:&lt;/p&gt;
&lt;p style="text-align: left;"&gt;At the top of the page,you will see the style has been added.&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;phone:PhoneApplicationPage.Resources&amp;gt;&lt;br /&gt;
&amp;lt;Style x:Key="MyTitleStyle" TargetType="TextBlock"&amp;gt;&lt;br /&gt;
&amp;lt;Setter Property="Foreground"&amp;gt;&lt;br /&gt;
&amp;lt;Setter.Value&amp;gt;&lt;br /&gt;
&amp;lt;SolidColorBrush Color="{StaticResource PhoneAccentColor}"&amp;gt;&lt;br /&gt;
&amp;lt;/Setter.Value&amp;gt;&lt;br /&gt;
&amp;lt;/Setter&amp;gt;&lt;br /&gt;
&amp;lt;Style&amp;gt; &lt;br /&gt;
&amp;lt;/phone:PhoneApplicationPage.Resources&amp;gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;7. &amp;nbsp;However, now this style can only be used within this page. If you want it to become a global style, you can cut/paste this style into App.xaml section Application.Recources, showed as below:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;Application.Resources&amp;gt;&lt;br /&gt;
&amp;lt;Style x:Key="MyTitleStyle" TargetType="TextBlock"&amp;gt;&lt;br /&gt;
&amp;lt;Setter Property="Foreground"&amp;gt;&lt;br /&gt;
&amp;lt;Setter.Value&amp;gt;&lt;br /&gt;
&amp;lt;SolidColorBrush Color="{StaticResource PhoneAccentColor}"&amp;gt;&lt;br /&gt;
&amp;lt;/Setter.Value&amp;gt;&lt;br /&gt;
&amp;lt;/Setter&amp;gt;&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/Application.Resources&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or when you try to build a new template, choose the scope as Application.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="195" width="360" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step14-600x325.png" title="Application" class="aligncenter size-large wp-image-1528" /&gt;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;8. Now this style could be used in entire project. App.xaml's resource section could be used as a global CSS file. As such, you could manage your style more efficiently.&lt;/p&gt;
&lt;p&gt;Secondly, we will try to add Visual States to a Control, for instance, add Pressed State effect to a button. There are different common states that a button could have, such as Normal, MouseOver, Pressed, Disabled... It is important to make changes to the states so that user get a sense of the result of his/her action. For example, we could make the button's label transforms.&lt;/p&gt;
&lt;p&gt;1. Create a button on the MainPage.xaml. You could drag and drop one button from Toolbox and name it NewBtn with content New. Once you are done, it should be something look like this:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step7/" rel="attachment wp-att-1517"&gt;&lt;img height="186" width="322" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step7.png" title="Create Button" class="aligncenter size-full wp-image-1517" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. Repeat what we have done just now. Right Click on MainPage.xaml and choose to &lt;em&gt;Open In Expression Blend...&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;3. In Expression Blend, right click on New Button and choose &lt;em&gt;Edit Template&lt;/em&gt; -&amp;gt;&lt;em&gt;Edit a Copy&lt;/em&gt;... Then you will see in the &lt;em&gt;Objects and Timeline&lt;/em&gt; window, button control breaks down into &lt;em&gt;ButtonBackground&lt;/em&gt; and &lt;em&gt;ContentContainer.&lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="215" width="238" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step10.png" title="Objects and Timeline" class="aligncenter size-full wp-image-1523" /&gt;&lt;/p&gt;
&lt;p&gt;4. Switch to States Window and you will see different CommonStates and FocusStates here. If you couldn't find the window, go to top menu bar. Under &lt;em&gt;Window&lt;/em&gt;-&amp;gt;; &lt;em&gt;States&lt;/em&gt;. Make sure it is ticked.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="292" width="263" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step111.png" title="State Window" class="size-full wp-image-1524  aligncenter" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step11/" rel="attachment wp-att-1524"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5. Click on &lt;em&gt;Pressed &lt;/em&gt;States and you may notice on the right top corner, it shows &lt;em&gt;Pressed State recording is on. &lt;/em&gt;From Object and Timeline window, there are &lt;em&gt;Background &lt;/em&gt;and &lt;em&gt;BorderBrush &lt;/em&gt;under ButtonBackground. That's because initially, there is default animation of button control, once user clicks the button, its Background and BorderBrush will change colors.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="181" width="177" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step13.png" title="transform" class="size-full wp-image-1527  aligncenter" /&gt;&lt;/p&gt;
&lt;p&gt;
6. Click on ContentContainer. We want to add an effect to make words transform while user is pressing the button. Find Transform under Properties panal and click on the Scale icon. Change X into -1. Click on Base States to stop recording.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="221" width="242" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step12.png" title="Recording" class="aligncenter size-full wp-image-1526" /&gt;&lt;/p&gt;
&lt;p&gt;
7. Now, press F5 and see how it looks like. Click on New button and you will see the background changes as well as the label transformed.
Thirdly, I will show you how to make an image to button and create pressed effect.
1. Prepare two images that used as button later on, as showed below. Right Click on your project name and choose &lt;em&gt;add existing item... &lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;em&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/check_48/" rel="attachment wp-att-1539"&gt;&lt;img height="48" width="48" src="http://innovativesingapore.com/wp-content/uploads/2010/08/check_48.png" title="check_Before_Click" class="aligncenter size-full wp-image-1539" /&gt;&lt;/a&gt;
&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/check_blue/" rel="attachment wp-att-1540"&gt;&lt;img height="48" width="48" src="http://innovativesingapore.com/wp-content/uploads/2010/08/check_Blue.png" title="check_After_Click" class="aligncenter size-full wp-image-1540" /&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
2. Drag and drop the light green check icon onto canvas.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step15/" rel="attachment wp-att-1542"&gt;&lt;img height="150" width="243" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step15.png" title="Check On canvas" class="aligncenter size-full wp-image-1542" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;3. Right-click on the check image and select &lt;em&gt;Make Into Control... &lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step16/" rel="attachment wp-att-1543"&gt;&lt;img height="170" width="216" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step16-600x472.png" title="make into control" class="aligncenter size-large wp-image-1543" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;4. Choose Control Type &lt;em&gt;Button &lt;/em&gt;and type in name &lt;em&gt;checkBtn&lt;/em&gt;. Define in this document. Here we are making that image acts like a real button.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step17/" rel="attachment wp-att-1544"&gt;&lt;img height="279" width="324" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step17-600x516.png" title="button " class="aligncenter size-large wp-image-1544" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;5. Select checkBtn and edit &lt;em&gt;Content&lt;/em&gt; under Common Properties to &lt;em&gt;Yes&lt;/em&gt;. Meanwhile, rearrange the word Yes to the right corner for making the button looks better.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step18/" rel="attachment wp-att-1545"&gt;&lt;img height="100" width="257" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step18.png" title="Yes" class="aligncenter size-full wp-image-1545" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="143" width="286" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step19.png" title="Button" class="size-full wp-image-1546  aligncenter" /&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;6. Choose Yes Button, right-click and choose &lt;em&gt;Edit template -&amp;gt;; Edit Current&lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;em&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step20/" rel="attachment wp-att-1547"&gt;&lt;img height="236" width="288" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step20-600x491.png" title="Edit template" class="aligncenter size-large wp-image-1547" /&gt;&lt;/a&gt;&lt;span style="font-style: normal;"&gt; &lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
7. Choose [Grid] in Objects and Timeline windows and double click on dark green icon file in Project windows and you will see something like the picture showed below:
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step21/" rel="attachment wp-att-1548"&gt;&lt;img height="212" width="253" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step21.png" title="Object and TimeLine" class="aligncenter size-full wp-image-1548" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;8. Click on Dark Green Image and set Opacity to 0%. What I wanted to do here is to show dark green check icon once user clicks on the button. So we will set Opacity back to 100% in the animation later.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/08/experession_phone/step22/" rel="attachment wp-att-1549"&gt;&lt;img height="172" width="256" src="http://innovativesingapore.com/wp-content/uploads/2010/08/Step22.png" title="Opacity" class="aligncenter size-full wp-image-1549" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;9. Click on Pressed in States panel. Click on light green image and change Opacity to 0% and click on dark green image and change Opacity to 100%. Click on Base States to stop recording.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;10. Now Press F5, you will see how your image act as a button and animated once user pressed on it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070791" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Phone+7/">Windows Phone 7</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Expression+Blend/">Expression Blend</category></item><item><title>Windows Phone 7 : How to Store Data and Pass Data between Pages</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/windows-phone-7-how-to-store-data-and-pass-data-between-pages.aspx</link><pubDate>Sun, 03 Oct 2010 09:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070788</guid><dc:creator>Mingfei</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10070788</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/windows-phone-7-how-to-store-data-and-pass-data-between-pages.aspx#comments</comments><description>&lt;p&gt;This is a walk-through tutorial for&amp;nbsp;demonstrating&amp;nbsp;following functions:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Store data on Windows Phone 7 by using Isolated Storage&lt;/li&gt;
&lt;li&gt;Pass data through parameter between pages&lt;/li&gt;
&lt;li&gt;Dynamic generate data grid, which contains data and related link button&lt;/li&gt;
&lt;li&gt;Use XElement, XAttribute as data structure&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I will explain related concepts through codes step by step. This application is used as a shopping list. Users will be able to key-in items they want to shop and view the shopping list as well. Add and Open function are implemented and I will leave remove function for you to try out.
Before start, You could download sourcecode &lt;a href="http://innovativesingapore.com/wp-content/uploads/2010/09/ShoppingList-Demo1.zip"&gt;here&lt;/a&gt;. And Windows Phone 7 developer package could be downloaded &lt;a href="http://developer.windowsphone.com/"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;
1. Click on File -&amp;gt; New-&amp;gt; Project ... Let's name the project: ShoppingList_Demo.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img class="size-large wp-image-1763 aligncenter" title="Create New Project" src="http://innovativesingapore.com/wp-content/uploads/2010/09/pic1-600x412.jpg" width="600" height="412" /&gt;&lt;/p&gt;
&lt;p&gt;
2. Open Solution Explorer on the right side and right-click on References -&amp;gt; Add Reference... Here, select System.Xml. Linq. We will use XElement and XAttribute later, which is inside System.Xml.Linq package.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a rel="attachment wp-att-1766" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot001/"&gt;&lt;img class="size-full wp-image-1766 aligncenter" title="Add Reference" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot001.jpg" width="474" height="404" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
3. We will create a page for inserting shopping list records, so that we could retrieve records later. Right-Click on ShoppingList_Demo and select Add-&amp;gt;New Item... Name the new page as AddItem.xaml.&lt;/p&gt;
&lt;p&gt;4. Open AddItem.xaml, in TitlePanel, replace the ApplicationTitle as "My Shopping List" and replace Page Title as "New Item". Code is showed as below:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt; &amp;lt;!--TitlePanel contains the name of the application and page title--&amp;gt;&lt;br /&gt;
        &amp;lt;StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12"&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="ApplicationTitle" Text="My Shopping List" Style="{StaticResource PhoneTextNormalStyle}"/&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="PageTitle" Text="New Item" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/&amp;gt;&lt;br /&gt;
        &amp;lt;/StackPanel&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;5. Inside ContentGrid panel, put in code showed as below:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="csharp"&gt; &amp;lt;!--ContentPanel - place additional content here--&amp;gt;
        &amp;lt;Grid x:Name="ContentGrid" Grid.Row="1"&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;
                &amp;lt;RowDefinition /&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition Width="100*" /&amp;gt;
                &amp;lt;ColumnDefinition Width="346*"/&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Grid.Column="0" Grid.Row="0" Text="Name:" HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBox Name="nameTxt"  Grid.Column="1" Margin="8" Padding="2" Height="59"  /&amp;gt;

            &amp;lt;TextBlock Grid.Column="0" Grid.Row="1" Text="Price:"  HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBox x:Name="priceTxt"  Grid.Column="1" Margin="8" Padding="2" Height="59" Grid.Row="1"  /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Grid.Column="0" Grid.Row="2" Text="Quantity:" HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBox Name="quanTxt" Grid.Column="1" Margin="8" Padding="2" Height="59" Grid.Row="2" /&amp;gt;&lt;br /&gt;
        &amp;lt;/Grid&amp;gt;&lt;br /&gt;
        &amp;lt;Button x:Name="BtnSave" Content="Save" HorizontalAlignment="Right" Margin="0,0,17,0" Grid.Row="1" VerticalAlignment="Bottom" Click="BtnSave_Click" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Basically, it helps you to populate a layout showed as below:
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a rel="attachment wp-att-1767" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot002/"&gt;&lt;img class="aligncenter size-full wp-image-1767" title="New Item page" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot002.jpg" width="203" height="337" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
Let me explain the code here. Inside a grid, there are two types of definition. One is RowDefinition. As you can see here, we populate three rows with minheight 72.5 and the Grid will auto-fill the last row with proper height. The another one is ColumnDefinition. Here we specify them as 100* and 346*, which means the whole column width was devided by 100+346=446 units and the first column takes 100 units and the second column takes 346 units.
In each TextBlock, take the first one as a example. Grid.Row="0" and Grid.Column="0" indicate this TextBlock cell located in the first row and first column of the Grid. The rest components of the UI I believe are quite straight-forward to&amp;nbsp;understand.&lt;/p&gt;
&lt;p&gt;
6. Choose Save button in the UI and double-click. It will bring you to the code-behind, which is BtnSave_Click method.
&lt;/p&gt;
&lt;p&gt;
7. Add two namespaces that we will be using later.&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;using System.IO.IsolatedStorage;
using System.Xml.Linq;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
8. Insert the following code to BtnSave_Click method:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())&lt;br /&gt;{
XDocument _doc = new XDocument();
XElement _item = new XElement(nameTxt.Text);
XAttribute price = new XAttribute("price", priceTxt.Text);
XAttribute quantity = new XAttribute("quantity", quanTxt.Text);
_item.Add(price, quantity);
_doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), _item);
IsolatedStorageFileStream location = new IsolatedStorageFileStream(nameTxt.Text + ".item", System.IO.FileMode.Create, storage);
System.IO.StreamWriter file = new System.IO.StreamWriter(location);
_doc.Save(file);
file.Dispose();
location.Dispose();
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&lt;/code&gt;&lt;span style="white-space: normal;"&gt;XElement is a class that represents an XML element and the fundamental XML construct. &amp;nbsp;And XAttribute is used to create attribute for a specific XML element. You could check out details &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement.aspx"&gt;here&lt;/a&gt;. Here, we construct a XML as the following output:

&amp;lt;root price="xx" quantity="xx"&amp;gt;&amp;lt;/root&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="scroll"&gt;&lt;span style="white-space: normal;"&gt;To store local data a on a Windows Phone 7 phone, the tool of choice is isolated storage. The reason to use "Isolated" is that all the data saved in one application can only be accessed within that application. You can check out more information &lt;a href="http://msdn.microsoft.com/en-us/library/3ak841sy(VS.80).aspx"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())&lt;/code&gt;&lt;span style="white-space: normal; "&gt;will allocate an instance for IsolatedStorageFile.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="scroll"&gt;&lt;span style="white-space: normal; "&gt;&amp;nbsp;Now, we will need to create a stream to write to. &lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;IsolatedStorageFileStream location = new IsolatedStorageFileStream(nameTxt.Text + ".item", System.IO.FileMode.Create, storage);&lt;/code&gt;&lt;/pre&gt;
Here, a new stream is written to file named "xx.item".
After that, you dispose the temp file and location since everything is saved into phone storage. And we return to MainPage.xaml for content display.&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;9.Add in a navigation from MainPage.html to AddItem.xaml Page. Firstly, insert this code below:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;phone:PhoneApplicationPage.ApplicationBar&amp;gt;&lt;br /&gt;
        &amp;lt;shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"&amp;gt;&lt;br /&gt;
            &amp;lt;shell:ApplicationBar.MenuItems&amp;gt;&lt;br /&gt;
                &amp;lt;shell:ApplicationBarMenuItem Text="new" Click="New_Click"/&amp;gt;&lt;br /&gt;
            &amp;lt;/shell:ApplicationBar.MenuItems&amp;gt;&lt;br /&gt;
        &amp;lt;/shell:ApplicationBar&amp;gt;&lt;br /&gt;
    &amp;lt;/phone:PhoneApplicationPage.ApplicationBar&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;10. Add a method in MainPage.xaml.cs to navigate to Add New Item page.&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;private void New_Click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/AddItem.xaml", UriKind.Relative));
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now Press Crtl+F5 and you will be able to see something like this while you click on ... in the interface.
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a rel="attachment wp-att-1770" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot003/"&gt;&lt;img class="size-full wp-image-1770  aligncenter" title="Navigation bar" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot003.jpg" width="253" height="388" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
11. We add a listBox in MainPage.xaml in order to display all the existing shopping lists. Add the coding below into &amp;lt;Grid x:Name="ContentGrid" ...&amp;gt;
&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;!--ContentPanel - place additional content here--&amp;gt;&lt;br /&gt;
&amp;lt;Grid x:Name="ContentGrid" Grid.Row="1"&amp;gt;
            &amp;lt;ListBox Grid.Row="0" Margin="10" FontSize="48" Name="Files"&amp;gt;
            &amp;lt;/ListBox&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;12. Now we will retrieve whatever shopping list the user has saved. Insert the following code into MainPage constructor (public MainPage()) right after InitializeComponent().&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;Loaded += (object sender, RoutedEventArgs e) =&amp;gt;&lt;br /&gt;{
Files.Items.Clear();
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
foreach (string filename in storage.GetFileNames("*.item"))
{
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;Grid a = new Grid();
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;ColumnDefinition col = new ColumnDefinition();
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;GridLength gl = new GridLength(200);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;col.Width = gl;
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;a.ColumnDefinitions.Add(col);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;ColumnDefinition col2 = new ColumnDefinition();
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;GridLength gl2 = new GridLength(200);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;col2.Width = gl;
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;a.ColumnDefinitions.Add(col2);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;TextBlock txbx = new TextBlock();
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;txbx.Text = filename;
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;Grid.SetColumn(txbx, 0);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;HyperlinkButton btn = new HyperlinkButton();
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;btn.Width = 100;
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;btn.Content = "Show";
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;btn.Name = filename;
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;btn.NavigateUri = new Uri("/DisplayPage.xaml?item=" + filename, UriKind.Relative);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;Grid.SetColumn(btn, 1);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;a.Children.Add(txbx);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;a.Children.Add(btn);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;Files.Items.Add(a);
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;}
&lt;span style="white-space:pre"&gt;	&lt;/span&gt;}
};&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, we are trying to create a dynamic grid layout on fly with two columns. One is for displaying the file name and the other is to display a hyperlinkButton that tight to file name. We will build a DisplayPage.xaml for displaying details of the shopping item later on.
&lt;/p&gt;
&lt;p&gt;Noticed,&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;btn.NavigateUri = new Uri("/DisplayPage.xaml?item=" + filename, UriKind.Relative);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, we use /DisplayPage.xaml ? item=.. to pass value of that specific item to the next page so that we know which shopping list's information we should display. This is very similar to how we pass parameters between web pages. Files here are the listBox functions as a&amp;nbsp;container&amp;nbsp;where content got displayed.
&lt;/p&gt;
&lt;p&gt;13. Now go back to MainPage.xaml. Press Ctrl+F5 and try to compile the file. Firstly, try to create some items if you don't have any. And after that, you should be able to see something like this:
&lt;a rel="attachment wp-att-1771" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot004/"&gt;&lt;/a&gt;You could&amp;nbsp;truncate file name to display item name more friendly.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img class="aligncenter size-full wp-image-1771" title="Display Items" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot004.jpg" width="253" height="434" /&gt;&lt;/p&gt;
&lt;p&gt;
14. Now we will go ahead implement DisplayPage.xaml in order to display each individual item with details. &amp;nbsp;Right-Click on ShoppingList-Demo project choose Add-&amp;gt;New Item... and choose Phone Portrait Page and name is DisplayPage.xaml.
&lt;/p&gt;
&lt;p&gt;
15. Insert following code pieces into DisplayPage.xaml right after&amp;nbsp;&amp;lt;!--TitlePanel contains the name of the application and page title--&amp;gt;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt; &amp;lt;!--TitlePanel contains the name of the application and page title--&amp;gt;&lt;br /&gt;
        &amp;lt;StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12"&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="PageTitle" Text="page name" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/&amp;gt;&lt;br /&gt;
        &amp;lt;/StackPanel&amp;gt;&lt;br /&gt;
        &amp;lt;!--ContentPanel - place additional content here--&amp;gt;&lt;br /&gt;
        &amp;lt;Grid x:Name="ContentGrid" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" Margin="10,10,10,77" ShowGridLines="True" Width="446" d:LayoutOverrides="GridBox"&amp;gt;&lt;br /&gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;&lt;br /&gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;&lt;br /&gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;&lt;br /&gt;
                &amp;lt;RowDefinition Height="Auto" MinHeight="72.5"/&amp;gt;&lt;br /&gt;
                &amp;lt;RowDefinition /&amp;gt;&lt;br /&gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;&lt;br /&gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;br /&gt;
                &amp;lt;ColumnDefinition Width="0.3*" /&amp;gt;&lt;br /&gt;
                &amp;lt;ColumnDefinition Width="*"/&amp;gt;&lt;br /&gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Grid.Column="0" Grid.Row="0" Text="Name:" HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Name="nameTxt"  Grid.Column="1" Margin="8" Padding="2" Height="59"  /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Grid.Row="1" Text="Price:" HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="priceTxt"  Grid.Column="1" Margin="8" Padding="2" Height="59" Grid.Row="1"  /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Grid.Column="0" Grid.Row="2" Text="Quantity:" HorizontalAlignment="Center" VerticalAlignment="Center" /&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock Name="quanTxt" Grid.Column="1" Margin="8" Padding="2" Height="59" Grid.Row="2" /&amp;gt;&lt;br /&gt;
        &amp;lt;/Grid&amp;gt;&lt;br /&gt;
        &amp;lt;Button x:Name="BtnBack" Content="Home" HorizontalAlignment="Right" Margin="0,0,17,0" Grid.Row="1" VerticalAlignment="Bottom" Click="BtnBack_Click" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This page's layout is almost identical to AddItem.xaml. Instead of having TextBox, we have all TextBlocks here to show information.&lt;/p&gt;
&lt;p&gt;
16. Insert these three namespaces into DisplayPage.xaml.cs file:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;using System.IO.IsolatedStorage;
using System.Xml.Linq;
using System.Windows.Navigation;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;17. Insert the following code into DisplayPage.xaml.cs:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;protected override void OnNavigatedTo(NavigationEventArgs e)&lt;br /&gt;
        {
            String itemName = "";
            base.OnNavigatedTo(e);
            bool itemExists = NavigationContext.QueryString.TryGetValue("item", out itemName);
            if (itemExists)
            {
                PageTitle.Text = itemName;
            }
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                XElement _xml;
                IsolatedStorageFileStream location = new IsolatedStorageFileStream(itemName, System.IO.FileMode.Open, storage);
                System.IO.StreamReader file = new System.IO.StreamReader(location);&lt;br /&gt;&lt;/code&gt;&lt;span style="font-family: monospace; "&gt;                _xml = XElement.Parse(file.ReadToEnd());&lt;/span&gt;&lt;span style="font-family: monospace; "&gt;   &lt;br /&gt;&lt;span style="white-space:pre"&gt;	&lt;/span&gt;             if (_xml.Name.LocalName != null)&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;                {&lt;br /&gt;
                    XAttribute priceTemp = _xml.Attribute("price");
                    priceTxt.Text = priceTemp.Value.ToLower();
                    XAttribute quanTemp = _xml.Attribute("quantity");
                    quanTxt.Text = quanTemp.Value.ToLower();
                    nameTxt.Text = itemName;&lt;br /&gt;
                }
                file.Dispose();
                location.Dispose();
            }
        }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, &lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;NavigationContext.QueryString.TryGetValue("item", out itemName);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;will return a boolean value to show whether this parameter's value has been passed from previous page. If it exists, we change the tile of this page to item name:&amp;nbsp;PageTitle.Text = itemName.&lt;/p&gt;
&lt;p&gt;
Furthermore, &lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;IsolatedStorageFileStream location = new IsolatedStorageFileStream(itemName, System.IO.FileMode.Open, storage);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;opens file "itemName" in local&amp;nbsp;storage. You may want to improve the code to check whether the file is there or not. For&amp;nbsp;demonstration&amp;nbsp;purpose, I try to simplify the process.However, this is a line that may cause problem if the system couldn't find the file.
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;System.IO.StreamReader file = new System.IO.StreamReader(location);_xml = XElement.Parse(file.ReadToEnd());&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is the code to parse file into XML elements and the following code is used to break down XML by elements and attributes. &lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;XAttribute priceTemp = _xml.Attribute("price");&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Lastly, we dispose the file and location created temporarily.&lt;/p&gt;
&lt;p&gt;18. Double-Click on the Home button in DisplayPage.xaml and a BtnBack_Click method will be auto-generated in DisplayPage.xaml. Insert the following code in to navigate this page:&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;private void BtnBack_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;19. Now Press Ctrl+F5 and you will be able to navigate between different pages with data stored and retrieved. Happy Shopping! :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a rel="attachment wp-att-1772" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot005/"&gt;&lt;img class="aligncenter size-full wp-image-1772" title="Add Item" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot005.jpg" width="243" height="416" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="attachment wp-att-1773" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot006/"&gt;&lt;img class="aligncenter size-full wp-image-1773" title="Display item" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot006.jpg" width="245" height="416" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="attachment wp-att-1774" href="http://innovativesingapore.com/2010/09/code-how-to-store-data-and-pass-data-in-windows-phone/screenshot007/"&gt;&lt;img class="aligncenter size-full wp-image-1774" title="display details" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot007.jpg" width="245" height="416" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070788" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Phone/">Windows Phone</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Phone+7/">Windows Phone 7</category></item><item><title>Deploying Existing Silverlight Application (Deep Zoom) on Windows Azure</title><link>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/deploying-existing-silverlight-application-deep-zoom-on-windows-azure.aspx</link><pubDate>Sun, 03 Oct 2010 08:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070783</guid><dc:creator>Mingfei</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/mingfeis_code_block/rsscomments.aspx?WeblogPostID=10070783</wfw:commentRss><comments>http://blogs.msdn.com/b/mingfeis_code_block/archive/2010/10/03/deploying-existing-silverlight-application-deep-zoom-on-windows-azure.aspx#comments</comments><description>&lt;p&gt;In this blog, I will introduce several Microsoft Technologies showed as below and you could view live demo on &lt;a href="http://tibet.cloudapp.net/"&gt;http://tibet.cloudapp.net/&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using &lt;a href="http://www.microsoft.com/uk/wave/software-deepzoom.aspx"&gt;Deep Zoom Composer&lt;/a&gt; to develop a Silverlight based photo gallery (You could use your existing Silverlight Application here)&lt;/li&gt;
&lt;li&gt;Migrate Existing Silverlight Application onto &lt;a href="http://www.microsoft.com/windowsazure/windowsazure/"&gt;Windows Azure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Deploy Windows Azure Application on Cloud&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Here, I will showcase how easily you could compose a Silverlight-based Deep Zoom applications onto cloud. You can skip part I if you plan to use your existing Silverlight application. Here, I will introduce a very powerful tool called Deep Zoom Composer in part I. If you have a lot of pictures to show, you can compose a Silverlight application easily for you to browser all the photos. You can check Hardrock caf&amp;eacute; example &lt;a href="http://memorabilia.hardrock.com/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="color: #ff8040;"&gt;Firstly, let's walk-through how to use Deep Zoom Composer to develop Siverlight based photo gallery.
&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #ff8040;"&gt;&lt;/span&gt;&lt;/strong&gt;1.&amp;nbsp; You need to download Deep Zoom Composer &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=457B17B7-52BF-4BDA-87A3-FA8A4673F8BF&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. This is a tool to allow the preparation of images for use with the Deep Zoom feature in Silverlight. Hard Rock is using Deep Zoom technology to feature their site, and you could take a look &lt;a href="http://memorabilia.hardrock.com/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
2.&amp;nbsp; After installation and open the tool. Select &lt;em&gt;&lt;strong&gt;File&lt;/strong&gt;&lt;/em&gt; - &lt;strong&gt;&lt;em&gt;New Project...&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp; You will see a&lt;strong&gt;&lt;em&gt; Add images &lt;/em&gt;&lt;/strong&gt;button in the right up corner. By clicking it, you could upload photos from your local drives.&lt;a href="http://innovativesingapore.com/?attachment_id=2367"&gt;&lt;/a&gt;
&lt;a href="http://innovativesingapore.com/?attachment_id=2367"&gt; &lt;/a&gt;
&lt;a href="http://innovativesingapore.com/?attachment_id=2367"&gt;&lt;img height="343" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot028-600x343.jpg" title="Add Images Deep Zoom" style="display: block; float: none; margin-left: auto; margin-right: auto;" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp; Next, click on &lt;strong&gt;&lt;em&gt;Compose&lt;/em&gt;&lt;/strong&gt; Icon on the Top Navigation Bar and you could compose your imagines on canvas by drag-and-drop. Noted, you could zoom in/out canvas to place photos with different sizes. Meanwhile, noted there are several functions lined up in the right side of the tool, such as Slide Show, Menu, Internal Links, External Links. You could drag photos from right sides into Slide show to compose the sequences of your slide show. Also, you could do the same for the rest. For internal/external links, you could specify link and when user clicks on the photo, he/she will be re-directed to the page that your link specified.&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/?attachment_id=2369"&gt;&lt;img height="354" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot0291-600x354.jpg" title="Compose Images" style="display: block; float: none; margin-left: auto; margin-right: auto;" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;5.&amp;nbsp; Now, click on &lt;strong&gt;&lt;em&gt;Export &lt;/em&gt;&lt;/strong&gt;Icon from the top navigation bar. Type in the name of your Deep Zoom application and choose location for your files as well. There are several templates you could choose from. And here, I will select Deep Zoom Navigation. And you could further customize your image settings. Click on Export.
&lt;a href="http://innovativesingapore.com/?attachment_id=2370"&gt;&lt;img height="351" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot030-600x351.jpg" title="Export" style="display: block; float: none; margin-left: auto; margin-right: auto;" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;6.&amp;nbsp; After exporting successfully, you will be able to either viewing your silverlight application in web browser or browse files in local folders.
&lt;a href="http://innovativesingapore.com/?attachment_id=2376"&gt;&lt;img height="264" width="548" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot0371.jpg" title="Exporting successfully" style="display: block; float: none; margin-left: auto; margin-right: auto;" /&gt;&lt;/a&gt;
&lt;strong&gt;&lt;span style="color: #ff8000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #ff8000;"&gt;Secondly, we will see how to Migrate Existing Silverlight Application onto Windows Azure.&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
7. Download Windows Azure SDK and Tools for Visual Studio &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2274a0a8-5d37-4eac-b50a-e197dc340f6f&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
8. Open Visual Studio as administrator. Current I am using Visual Studio 2010 for this example.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="207" width="416" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot049.jpg" title="Admin mode" class="aligncenter size-full wp-image-2402" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot049/" rel="attachment wp-att-2402"&gt;&lt;/a&gt;
9. Select &lt;strong&gt;&lt;em&gt;File &lt;/em&gt;&lt;/strong&gt;&amp;ndash;&amp;gt; &lt;strong&gt;&lt;em&gt;New &lt;/em&gt;&lt;/strong&gt;&amp;ndash;&amp;gt; &lt;strong&gt;&lt;em&gt;Project&lt;/em&gt;&lt;/strong&gt;&amp;hellip; Select Windows Azure Cloud Service in Visual C# Category.&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot031/" rel="attachment wp-att-2403"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="text-align: center; "&gt;&lt;img height="415" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot031-600x415.jpg" title="Cloud Service" class="aligncenter size-large wp-image-2403" /&gt;&lt;/p&gt;
&lt;p&gt;
9. Right click on &lt;strong&gt;&lt;em&gt;Role Folder&lt;/em&gt;&lt;/strong&gt; under TibetDemo project and select &lt;strong&gt;&lt;em&gt;New Web Role Project&amp;hellip;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="294" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/web-role-600x294.jpg" title="web role" class="aligncenter size-large wp-image-2408" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/web-role/" rel="attachment wp-att-2408"&gt;&lt;/a&gt;
10. Select &lt;em&gt;ASP.NET Web Role&lt;/em&gt; and to Cloud service solution and rename it as tibetWeb showed as below:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot0321-600x370.jpg" height="370" width="600" title="Web Role" class="aligncenter size-large wp-image-2406" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot032-2/" rel="attachment wp-att-2406"&gt;&lt;/a&gt;
11. Now, copy over files from XX\Documents\Expression\Deep Zoom Composer Projects\Tibet-Demo\Exported Data\tibet_demo (you may look for your own file directory) under this project. A quick way is to right click on tibetWeb and open folder in windows explorer.
12. Click on&amp;nbsp; Icon [Show all Files] showed below and you will see folder GeneratedImages showed in a dash line. Right-Click and select &lt;strong&gt;Included in the project&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot033-2/" rel="attachment wp-att-2407"&gt;&lt;img height="507" width="295" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot0331.jpg" title="Show All Files" class="size-full wp-image-2407  aligncenter" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
13. Open Web.Config and add in codes showed below to set the default starting page as Test.html. You need to modify the&amp;nbsp;&lt;strong&gt;&lt;em&gt;web.config&lt;/em&gt;&lt;/strong&gt; file and add the following setting in the&lt;em&gt; &lt;/em&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;system.Webserver&amp;gt;&lt;/em&gt;&lt;/strong&gt; section:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span class="sy0"&gt;&amp;lt;&lt;/span&gt;defaultDocument&lt;span class="sy0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="sy0"&gt;&amp;lt;&lt;/span&gt;files&lt;span class="sy0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="sy0"&gt;&amp;lt;&lt;/span&gt;add value&lt;span class="sy0"&gt;=&lt;/span&gt;&amp;rdquo;Test.&lt;span class="me1"&gt;html&lt;/span&gt;&amp;rdquo;&lt;span class="sy0"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="sy0"&gt;&amp;lt;/&lt;/span&gt;files&lt;span class="sy0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;span class="sy0"&gt;&amp;lt;/&lt;/span&gt;defaultDocument&lt;span class="sy0"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;14. Now compile and build your page. You could set Test.html as Start page by right clicking Test.html and test your Silverlight page locally.
&lt;/p&gt;
&lt;p&gt;
15. Right Click on TibetDemo Cloud project and select &lt;strong&gt;&lt;em&gt;Publish&lt;/em&gt;&lt;/strong&gt;&amp;hellip; and&amp;nbsp;&lt;strong&gt;&lt;em&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;Select &lt;/span&gt;&lt;/span&gt;Create Service Package Only&lt;/em&gt;&lt;/strong&gt;&amp;hellip; You will be able to see a folder pop up with all the publish documents.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="color: #ff8000;"&gt;Lastly, we will show you how to Deploy Windows Azure Application on Cloud. &lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #ff8000;"&gt;&lt;/span&gt;&lt;/strong&gt;
16. You need to go and register&amp;nbsp;&lt;a href="http://www.microsoft.com/windowsazure/offers/"&gt;here&lt;/a&gt; for a Azure account if you don&amp;rsquo;t have one.
&lt;/p&gt;
&lt;p&gt;
17. &lt;strong&gt;&lt;em&gt;Create a new service &lt;/em&gt;&lt;/strong&gt;under your Cloud server, choose Hosted Service showed as below:&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot038/" rel="attachment wp-att-2409"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="279" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot038-600x279.jpg" title="ScreenShot038" class="aligncenter size-large wp-image-2409" /&gt;&lt;/p&gt;
&lt;p&gt;
18. Type in a &lt;strong&gt;&lt;em&gt;Service Label &lt;/em&gt;&lt;/strong&gt;and&lt;strong&gt;&lt;em&gt; Service Description&lt;/em&gt;&lt;/strong&gt; showed as below to create a new service. Click on Next.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot040-600x526.jpg" height="526" width="600" title="ScreenShot040" class="aligncenter size-large wp-image-2411" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot039/" rel="attachment wp-att-2410"&gt;&lt;/a&gt;
19. Fill in Public Service Name, this will be the url to access your cloud application. Also, you could choose your server location as well. Click on Create once you have filled in all the information.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="320" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot039-600x320.jpg" title="ScreenShot039" class="aligncenter size-large wp-image-2410" /&gt;&lt;/p&gt;
&lt;p&gt;
20.&amp;nbsp; You will be able to see this screen showed below. Click on the arrow besides Production Cube, you could see Staging Cube. Grey color indicates cloud service is not running on cloud and hence you are not charged at this point of time.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="523" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot041-600x523.jpg" title="ScreenShot041" class="aligncenter size-large wp-image-2412" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot041/" rel="attachment wp-att-2412"&gt;&lt;/a&gt;
21. Click on Deploy&amp;hellip; and you will see a dialog showed as below. Select the folder where you Published your Cloud Service just now. Choose Application Package for the first Browse Button and choose configuration settings for the second Browse Button. Click on Deploy and application is deploying to the Cloud for you now.&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot042/" rel="attachment wp-att-2413"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="395" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot042-600x395.jpg" title="ScreenShot042" class="aligncenter size-large wp-image-2413" /&gt;&lt;/p&gt;
&lt;p&gt;
22. After Click &lt;em&gt;Deploy&lt;/em&gt;, click on &lt;strong&gt;&lt;em&gt;Run &lt;/em&gt;&lt;/strong&gt;and you will see the status of the application becomes Initializing. You need to wait for a while to see your page up. Basically, the status needs to be Ready with a green dot.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="452" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot053-600x452.jpg" title="ScreenShot053" class="aligncenter size-large wp-image-2414" /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot053/" rel="attachment wp-att-2414"&gt;&lt;/a&gt;
23. Remember that the computing hour is counted once the tube is blue. You need to click on suspend to stop the service. Now you can see the app up and running! Check out &lt;a href="http://tibet.cloudapp.net/"&gt;http://tibet.cloudapp.net/&lt;/a&gt; to see this up and&amp;nbsp;running&amp;nbsp;demo!
&lt;a href="http://innovativesingapore.com/2010/09/silverlight-windows-azure-cloud/screenshot056/" rel="attachment wp-att-2415"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img height="422" width="600" src="http://innovativesingapore.com/wp-content/uploads/2010/09/ScreenShot056-600x422.jpg" title="ScreenShot056" class="aligncenter size-large wp-image-2415" /&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070783" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Windows+Azure/">Windows Azure</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Cloud/">Cloud</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Deep+Zoom/">Deep Zoom</category><category domain="http://blogs.msdn.com/b/mingfeis_code_block/archive/tags/Silverlight/">Silverlight</category></item></channel></rss>