<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Designer Silverlight</title>
	<atom:link href="http://www.designersilverlight.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designersilverlight.com</link>
	<description>Matthias Shapiro's Silverlight &#38; WPF Blog - Because Developers Get All The Good Blogs</description>
	<lastBuildDate>Wed, 01 Sep 2010 17:27:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Windows Phone 7: Navigating After A Picture/Camera Task</title>
		<link>http://www.designersilverlight.com/2010/09/01/windows-phone-7-navigating-after-a-picture-task/</link>
		<comments>http://www.designersilverlight.com/2010/09/01/windows-phone-7-navigating-after-a-picture-task/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 17:21:21 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[NavigationService]]></category>
		<category><![CDATA[NullReferenceException]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[tombstoning]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=1075</guid>
		<description><![CDATA[While working on a Windows Phone 7 project I came up against a problem in which the project would crash after we took a picture, giving us the error: NavigationService.Navigate(new Uri(&#8220;/OurView/NextView.xaml&#8221;, UriKind.Relative)); The scenario we wanted went something like this: We wanted the user to tap a button and launch the camera task. This would [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a Windows Phone 7 project I came up against a problem in which the project would crash after we took a picture, giving us the error:</p>
<p>NavigationService.Navigate(<span style="color: #0000ff;">new</span> <span style="color: #2b91bc;">Uri</span>(<span style="color: #a31515;">&#8220;/OurView/NextView.xaml&#8221;</span>, <span style="color: #2b91bc;">UriKind</span>.Relative));</p>
<p>The scenario we wanted went something like this: We wanted the user to tap a button and launch the camera task. This would close (tombstone) the application until the camera task was complete (the user took a picture and returned to the app). Upon completion, the application is re-initiated and the camera task hands the application an image stream that we can use to determine the bar code number. We then navigate to a screen that will show all the information about the product the user just scanned.</p>
<p>The problem with this way of doing things is that when we tried to navigate to a new page in our camera.Completed event handler (helpfully titled camera_Completed), we got a NullReferenceException on our NavigationService.</p>
<p>&#8220;How could this be?&#8221; I asked myself and the Internet. The NavigationService was there when we left. How could it not be there when we got back? The Internet had no helpful answers. Stupid Internet.</p>
<p>As it turns out, the NavigationService doesn&#8217;t actually show up in a page until the page UI is fully loaded (or so I have been told). That means that we simply can&#8217;t navigate directly from the camera.Completed event because the UI isn&#8217;t loaded.</p>
<p>Most other Windows Phone 7 programs with camera tasks we looked at had some additional user input after the task was completed that users would then interact with to handle navigation. We didn&#8217;t want that. Once the user took a picture, we wanted them to start getting results without any additional interactions.</p>
<p>Here is our solution for navigating after the camera task (which will also work for navigating after any task):</p>
<p>First, add a property to the page that can determine if the application was initiated after the task.</p>
<p><span style="color: #0000ff;">bool</span> comingFromCamera = <span style="color: #0000ff;">false</span>;</p>
<p>Make sure you set this to true in your camera.Completed event handler:</p>
<p><span style="color: #0000ff;">void</span> camera_Completed(<span style="color: #0000ff;">object</span> sender, <span style="color: #2b91bc;">PhotoResult </span>e)<br />
{<br />
<span style="color: #0000ff;"> this</span>.comingFromCamera = <span style="color: #0000ff;">true</span>;<br />
}</p>
<p>Add an event handler for the page loading event  in the page constructor:</p>
<p><span style="color: #0000ff;">public</span> MainPage()<br />
{<br />
InitializeComponent();<br />
<span style="color: #008000;">// Whatever other stuff you need in here</span><br />
<span style="color: #0000ff;">this</span>.Loaded += <span style="color: #0000ff;">new</span> <span style="color: #2b91bc;">RoutedEventHandler</span>(MainPage_Loaded);<br />
}</p>
<p>In the MainPage_Loaded event handler, check to see if the page was initialized after the camera task or initialized normally. If it was initialized after the task, navigate to your heart&#8217;s content.</p>
<p><span style="color: #0000ff;">private void</span> MainPage_Loaded(<span style="color: #0000ff;">object</span> sender, <span style="color: #2b91bc;">RoutedEventArgs</span> e)<br />
{<br />
<span style="color: #0000ff;">if</span>(<span style="color: #0000ff;">this</span>.comingFromCamera)<br />
NavigationService.Navigate(<span style="color: #0000ff;">new</span><span style="color: #2b91bc;"> Uri</span>(<span style="color: #a31515;">&#8220;/OurView/NextView.xaml&#8221;</span>), <span style="color: #2b91bc;">UriKind</span>.Relative));<br />
}</p>
<p>And that should work. Let me know in the comments if you&#8217;re having additional difficulties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/09/01/windows-phone-7-navigating-after-a-picture-task/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Twitter Weekly Updates for 2010-08-29</title>
		<link>http://www.designersilverlight.com/2010/08/29/twitter-weekly-updates-for-2010-08-29/</link>
		<comments>http://www.designersilverlight.com/2010/08/29/twitter-weekly-updates-for-2010-08-29/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 21:43:00 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitter summaries]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/2010/08/29/twitter-weekly-updates-for-2010-08-29/</guid>
		<description><![CDATA[Apress &#34;Intoducing Silverlight 4&#34; e-book for $10 http://bit.ly/aAec0G # You&#039;re really just borrowing Steve Jobs&#039; iPhone, not buying your own http://bit.ly/cweTwu via @CaseySoftware # +1 RT @adkinn: iPhone to Windows Phone 7 Tutorial series from @JesseLiberty http://bit.ly/cUUAWM &#8211; Looking forward to this! # @nathandunlap That is why Twitter (and Twitter clients) need a 10 second [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-1074"></span></p>
<ul class="aktt_tweet_digest">
<li>Apress &quot;Intoducing Silverlight 4&quot; e-book for $10 <a href="http://bit.ly/aAec0G" rel="nofollow">http://bit.ly/aAec0G</a> <a href="http://twitter.com/matthiasshapiro/statuses/21871566180" class="aktt_tweet_time">#</a></li>
<li>You&#039;re really just borrowing Steve Jobs&#039; iPhone, not buying your own <a href="http://bit.ly/cweTwu" rel="nofollow">http://bit.ly/cweTwu</a> via @<a href="http://twitter.com/CaseySoftware" class="aktt_username">CaseySoftware</a> <a href="http://twitter.com/matthiasshapiro/statuses/21923814985" class="aktt_tweet_time">#</a></li>
<li>+1 RT @<a href="http://twitter.com/adkinn" class="aktt_username">adkinn</a>: iPhone to Windows Phone 7 Tutorial series from @<a href="http://twitter.com/JesseLiberty" class="aktt_username">JesseLiberty</a> <a href="http://bit.ly/cUUAWM" rel="nofollow">http://bit.ly/cUUAWM</a> &#8211; Looking forward to this! <a href="http://twitter.com/matthiasshapiro/statuses/21929432034" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/nathandunlap" class="aktt_username">nathandunlap</a> That is why Twitter (and Twitter clients) need a 10 second &quot;undo&quot; button. Dammit. <a href="http://twitter.com/nathandunlap/statuses/21929807293" class="aktt_tweet_reply">in reply to nathandunlap</a> <a href="http://twitter.com/matthiasshapiro/statuses/21929996245" class="aktt_tweet_time">#</a></li>
<li>for @<a href="http://twitter.com/justsomeguy" class="aktt_username">justsomeguy</a> RT @<a href="http://twitter.com/TIME" class="aktt_username">TIME</a>: It&#039;s National Waffle Day. Check out the five coolest waffle makers | <a href="http://su.pr/479RLz" rel="nofollow">http://su.pr/479RLz</a> <a href="http://twitter.com/matthiasshapiro/statuses/22013067767" class="aktt_tweet_time">#</a></li>
<li>It looks like I will, totally by accident, be in Munich during Oktoberfest. Freaking score. <a href="http://twitter.com/matthiasshapiro/statuses/22105124028" class="aktt_tweet_time">#</a></li>
<li>Customizing an application tile in Windows Phone 7 #<a href="http://search.twitter.com/search?q=%23wp7" class="aktt_hashtag">wp7</a> #wp7dev <a href="http://bit.ly/bbXbjD" rel="nofollow">http://bit.ly/bbXbjD</a> <a href="http://twitter.com/matthiasshapiro/statuses/22212306663" class="aktt_tweet_time">#</a></li>
<li>Related: Sending Push Notification to Windows Phone 7 #<a href="http://search.twitter.com/search?q=%23wp7" class="aktt_hashtag">wp7</a> #wp7dev <a href="http://bit.ly/cGCLlo" rel="nofollow">http://bit.ly/cGCLlo</a> <a href="http://twitter.com/matthiasshapiro/statuses/22212628528" class="aktt_tweet_time">#</a></li>
<li>A list of apps &amp; tasks you can launch from within your Windows Phone 7 app #<a href="http://search.twitter.com/search?q=%23Launchers" class="aktt_hashtag">Launchers</a> <a href="http://bit.ly/aHIDvE" rel="nofollow">http://bit.ly/aHIDvE</a> <a href="http://twitter.com/matthiasshapiro/statuses/22231462025" class="aktt_tweet_time">#</a></li>
<li>Windows Phone 7 comes pre-loaded with Jack Bauer&#039;s direct number #<a href="http://search.twitter.com/search?q=%23WP7KillerApp" class="aktt_hashtag">WP7KillerApp</a> <a href="http://twitter.com/matthiasshapiro/statuses/22268031919" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/MSExpression" class="aktt_username">MSExpression</a>: MultiTouch Behavior for Windows Phone 7 &#8211; <a href="http://bit.ly/9PF7BS" rel="nofollow">http://bit.ly/9PF7BS</a> &#8211; #<a href="http://search.twitter.com/search?q=%23Expression" class="aktt_hashtag">Expression</a> #Blend #<a href="http://search.twitter.com/search?q=%23WP7" class="aktt_hashtag">WP7</a> <a href="http://twitter.com/matthiasshapiro/statuses/22283696172" class="aktt_tweet_time">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/08/29/twitter-weekly-updates-for-2010-08-29/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Weekly Updates for 2010-08-22</title>
		<link>http://www.designersilverlight.com/2010/08/22/twitter-weekly-updates-for-2010-08-22/</link>
		<comments>http://www.designersilverlight.com/2010/08/22/twitter-weekly-updates-for-2010-08-22/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 21:43:00 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitter summaries]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/2010/08/22/twitter-weekly-updates-for-2010-08-22/</guid>
		<description><![CDATA[@Chris_Mayer I&#039;m partial to the 22-23 inch monitors, the price-to-quality is just right for me. in reply to Chris_Mayer # Sunday only, get Accelerated SQL Server 2008 e-book from Apress for $10 http://bit.ly/aAec0G # 30 free high quality fonts http://bit.ly/9cdc3l # RT @biginjapaninc: TechNews.AM &#124; ShopSavvy for Windows Phone 7 Screenshots &#8211; http://cot.ag/dg3sQd # Note [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-1073"></span></p>
<ul class="aktt_tweet_digest">
<li>@<a href="http://twitter.com/Chris_Mayer" class="aktt_username">Chris_Mayer</a> I&#039;m partial to the 22-23 inch monitors, the price-to-quality is just right for me. <a href="http://twitter.com/Chris_Mayer/statuses/21180257209" class="aktt_tweet_reply">in reply to Chris_Mayer</a> <a href="http://twitter.com/matthiasshapiro/statuses/21240607875" class="aktt_tweet_time">#</a></li>
<li>Sunday only, get Accelerated SQL Server 2008 e-book from Apress for $10 <a href="http://bit.ly/aAec0G" rel="nofollow">http://bit.ly/aAec0G</a> <a href="http://twitter.com/matthiasshapiro/statuses/21268297105" class="aktt_tweet_time">#</a></li>
<li>30 free high quality fonts <a href="http://bit.ly/9cdc3l" rel="nofollow">http://bit.ly/9cdc3l</a> <a href="http://twitter.com/matthiasshapiro/statuses/21276417234" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/biginjapaninc" class="aktt_username">biginjapaninc</a>: TechNews.AM | ShopSavvy for Windows Phone 7 Screenshots &#8211; <a href="http://cot.ag/dg3sQd" rel="nofollow">http://cot.ag/dg3sQd</a> <a href="http://twitter.com/matthiasshapiro/statuses/21283394588" class="aktt_tweet_time">#</a></li>
<li>Note to self: RT @<a href="http://twitter.com/ShawnWildermuth" class="aktt_username">ShawnWildermuth</a>: Blogged: What I learned about Windows Phone 7 from Android <a href="http://is.gd/ejE6Q" rel="nofollow">http://is.gd/ejE6Q</a> <a href="http://twitter.com/matthiasshapiro/statuses/21294498435" class="aktt_tweet_time">#</a></li>
<li>Smashing Magazine post: &quot;1001 Blog Posts That Are More Info Dump Than Helpful Information&quot; <a href="http://twitter.com/matthiasshapiro/statuses/21319722553" class="aktt_tweet_time">#</a></li>
<li>Based on current growth patterns, our baby should look like this (lower right) <a href="http://yfrog.com/nfaitp" rel="nofollow">http://yfrog.com/nfaitp</a> <a href="http://twitter.com/matthiasshapiro/statuses/21326837778" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/spangborn" class="aktt_username">spangborn</a> Oooo&#8230; green tea sounds good #<a href="http://search.twitter.com/search?q=%23Impressionable" class="aktt_hashtag">Impressionable</a> (Also, Oolong is nice and Rooibos if you like something sweet) <a href="http://twitter.com/spangborn/statuses/21327940329" class="aktt_tweet_reply">in reply to spangborn</a> <a href="http://twitter.com/matthiasshapiro/statuses/21328227183" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/myzt" class="aktt_username">myzt</a>, @<a href="http://twitter.com/SharpGIS" class="aktt_username">SharpGIS</a>: The main idea of &quot;Inception&quot;: if you run a VM inside a VM inside a VM inside a VM, everything will be very slow <a href="http://twitter.com/matthiasshapiro/statuses/21333436913" class="aktt_tweet_time">#</a></li>
<li>Geo tag testing, 1, 2, 3  <a href="http://yfrog.com/j7g14gp" rel="nofollow">http://yfrog.com/j7g14gp</a> <a href="http://yfrog.com/8bpxhp" rel="nofollow">http://yfrog.com/8bpxhp</a> <a href="http://twitter.com/matthiasshapiro/statuses/21340651590" class="aktt_tweet_time">#</a></li>
<li>Creating sample data in XAML for Windows Phone 7 project. Super. Awesome. #<a href="http://search.twitter.com/search?q=%23wp7" class="aktt_hashtag">wp7</a> <a href="http://twitter.com/matthiasshapiro/statuses/21373948256" class="aktt_tweet_time">#</a></li>
<li>You audio people are freaking weird. How is a $1000 speakers set &quot;entry level&quot;? My TV cost that much. <a href="http://twitter.com/matthiasshapiro/statuses/21376096127" class="aktt_tweet_time">#</a></li>
<li>1 thing I don&#039;t like about Blend #<a href="http://search.twitter.com/search?q=%23WP7" class="aktt_hashtag">WP7</a> default projects: The data templates are in line. Harder to style. <a href="http://twitter.com/matthiasshapiro/statuses/21376602107" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/rustyclark" class="aktt_username">rustyclark</a> Can you point me to a good intro on determining speaker quality? I&#039;m basically guessing right now. <a href="http://twitter.com/rustyclark/statuses/21409378120" class="aktt_tweet_reply">in reply to rustyclark</a> <a href="http://twitter.com/matthiasshapiro/statuses/21409907305" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/rustyclark" class="aktt_username">rustyclark</a> Mostly movies. I listen to most of my music in my office, but it&#039;s nice to sit down and enjoy quality music every now &amp; again <a href="http://twitter.com/rustyclark/statuses/21412403410" class="aktt_tweet_reply">in reply to rustyclark</a> <a href="http://twitter.com/matthiasshapiro/statuses/21412628010" class="aktt_tweet_time">#</a></li>
<li>I start pinching my face like a Victorian woman on a date #<a href="http://search.twitter.com/search?q=%23SignsImWorkingTooHard" class="aktt_hashtag">SignsImWorkingTooHard</a> <a href="http://twitter.com/matthiasshapiro/statuses/21414964873" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/rickbarraza" class="aktt_username">rickbarraza</a> You&#039;re just being difficult now <img src='http://www.designersilverlight.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://twitter.com/rickbarraza/statuses/21415886085" class="aktt_tweet_reply">in reply to rickbarraza</a> <a href="http://twitter.com/matthiasshapiro/statuses/21417313596" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/EATerrell" class="aktt_username">EATerrell</a>: Interesting Infographic &quot;The Worlds Best Countries&quot; via @<a href="http://twitter.com/newsweek" class="aktt_username">newsweek</a> <a href="http://bit.ly/a0qIAu" rel="nofollow">http://bit.ly/a0qIAu</a> <a href="http://twitter.com/matthiasshapiro/statuses/21417344206" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/JustinAngel" class="aktt_username">JustinAngel</a> I was just noticing that. But the interaction &amp; visualization is awesome. @<a href="http://twitter.com/EATerrell" class="aktt_username">EATerrell</a> <a href="http://twitter.com/matthiasshapiro/statuses/21417975046" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/rickbarraza" class="aktt_username">rickbarraza</a> I&#039;m not moving to San Diego because I hate sunshine and happiness. <a href="http://twitter.com/rickbarraza/statuses/21417891293" class="aktt_tweet_reply">in reply to rickbarraza</a> <a href="http://twitter.com/matthiasshapiro/statuses/21418033769" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/ShawnWildermuth" class="aktt_username">ShawnWildermuth</a> Here&#039;s the one I use <a href="http://bit.ly/bjk2vj" rel="nofollow">http://bit.ly/bjk2vj</a> <a href="http://twitter.com/ShawnWildermuth/statuses/21420032904" class="aktt_tweet_reply">in reply to ShawnWildermuth</a> <a href="http://twitter.com/matthiasshapiro/statuses/21420337403" class="aktt_tweet_time">#</a></li>
<li>Wife: They&#039;re selling coffee-free Starbucks ice cream. Me: Isn&#039;t that just regular ice cream? <a href="http://twitter.com/matthiasshapiro/statuses/21436442552" class="aktt_tweet_time">#</a></li>
<li>For reasons that US News &amp; World Report wants me to pay to see, Georgia Tech is the 35th best school in the US <a href="http://twitter.com/matthiasshapiro/statuses/21437014150" class="aktt_tweet_time">#</a></li>
<li>does anyone know how the Windows Phone 7 system decides scroll position when bringing a textbox in focus? <a href="http://twitter.com/matthiasshapiro/statuses/21444532444" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/timheuer" class="aktt_username">timheuer</a>: DynamicTextBlock works for windows phone dev <a href="http://timh.me/b9UrJj" rel="nofollow">http://timh.me/b9UrJj</a> #<a href="http://search.twitter.com/search?q=%23wp7dev" class="aktt_hashtag">wp7dev</a> #silverlight <a href="http://twitter.com/matthiasshapiro/statuses/21466668067" class="aktt_tweet_time">#</a></li>
<li>Asshole tenants put unbagged food trash in our garbage can so it spilled out this morning. Why? WHY?!? <a href="http://twitter.com/matthiasshapiro/statuses/21500537238" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/Pete_Brown" class="aktt_username">Pete_Brown</a> Maybe something like &quot;I&#039;ll just stick that one in my &#039;Mind Your Own Business&#039; file&quot; <a href="http://twitter.com/Pete_Brown/statuses/21500995040" class="aktt_tweet_reply">in reply to Pete_Brown</a> <a href="http://twitter.com/matthiasshapiro/statuses/21501472078" class="aktt_tweet_time">#</a></li>
<li>Someday I&#039;m going to write a &quot;Margin Armageddon&quot; script that sets all margins &amp; padding in a WPF/SL project to 0. Scorched earth! <a href="http://twitter.com/matthiasshapiro/statuses/21512812244" class="aktt_tweet_time">#</a></li>
<li>The Steve Jobs Exemption Clause: All statements about how to do good design workflow do not apply to Apple. <a href="http://twitter.com/matthiasshapiro/statuses/21515575837" class="aktt_tweet_time">#</a></li>
<li>The Steve Jobs Exclusivity Clause: Very few Apple design workflows can be translated effectively to any other company. <a href="http://twitter.com/matthiasshapiro/statuses/21515636327" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/Pete_Brown" class="aktt_username">Pete_Brown</a> That thing is gorgeous! Where do I go to make that screen? <a href="http://twitter.com/Pete_Brown/statuses/21516798101" class="aktt_tweet_reply">in reply to Pete_Brown</a> <a href="http://twitter.com/matthiasshapiro/statuses/21517142598" class="aktt_tweet_time">#</a></li>
<li>NUIGroup.com has a free book on DYI multi-touch displays <a href="http://bit.ly/9uCYha" rel="nofollow">http://bit.ly/9uCYha</a> (via @<a href="http://twitter.com/joshblake" class="aktt_username">joshblake</a>) <a href="http://twitter.com/matthiasshapiro/statuses/21517584952" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/lizardbill" class="aktt_username">lizardbill</a>: Some learn best by reading.  Some by doing.  I learn best by publicly embarrassing myself. <a href="http://twitter.com/matthiasshapiro/statuses/21518007237" class="aktt_tweet_time">#</a></li>
<li>It is one of those days in SLC where no amount of swamp cooler can make the house cool enough. #<a href="http://search.twitter.com/search?q=%23NeedAC" class="aktt_hashtag">NeedAC</a> <a href="http://twitter.com/matthiasshapiro/statuses/21520040977" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/joshblake" class="aktt_username">joshblake</a> Re: Margin Armageddon: I&#039;ve done several projects where I have to go searching through templates for that 2 px misalignment&#8230; <a href="http://twitter.com/joshblake/statuses/21512851380" class="aktt_tweet_reply">in reply to joshblake</a> <a href="http://twitter.com/matthiasshapiro/statuses/21526117605" class="aktt_tweet_time">#</a></li>
<li>5-hour Energy, I am now your slave. <a href="http://twitter.com/matthiasshapiro/statuses/21613106171" class="aktt_tweet_time">#</a></li>
<li>Windows Phone 7 Essential Control: @<a href="http://twitter.com/ingebretsen" class="aktt_username">ingebretsen</a>&#039;s TextTrimming TextBlock <a href="http://bit.ly/cvRWeD" rel="nofollow">http://bit.ly/cvRWeD</a> #<a href="http://search.twitter.com/search?q=%23wp7dev" class="aktt_hashtag">wp7dev</a> #wp7 <a href="http://twitter.com/matthiasshapiro/statuses/21614850228" class="aktt_tweet_time">#</a></li>
<li>Windows Phone 7 Essential Control: WrapPanel (stolen from @<a href="http://twitter.com/jeffwilcox" class="aktt_username">jeffwilcox</a>) <a href="http://bit.ly/c0Obmg" rel="nofollow">http://bit.ly/c0Obmg</a> #<a href="http://search.twitter.com/search?q=%23wp7dev" class="aktt_hashtag">wp7dev</a> #wp7 <a href="http://twitter.com/matthiasshapiro/statuses/21615183647" class="aktt_tweet_time">#</a></li>
<li>RT @<a href="http://twitter.com/SilverlightNews" class="aktt_username">SilverlightNews</a>: Improving ListBox Performance in Silverlight for Windows Phone 7: Data Virtualization &#8211; <a href="http://bit.ly/clxvEr" rel="nofollow">http://bit.ly/clxvEr</a> <a href="http://twitter.com/matthiasshapiro/statuses/21671120926" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/JeffParies" class="aktt_username">JeffParies</a> Laptop upgrade: I love my Studio XPS 16. (i7, 8GB Ram, 1080p) However, it does light my jeans on fire. <a href="http://twitter.com/JeffParies/statuses/21673337613" class="aktt_tweet_reply">in reply to JeffParies</a> <a href="http://twitter.com/matthiasshapiro/statuses/21673737406" class="aktt_tweet_time">#</a></li>
<li>Windows Phone 7 ListBox doesn&#039;t use virtualization unless using a DataTemplate? Weird. <a href="http://bit.ly/acCGxx" rel="nofollow">http://bit.ly/acCGxx</a> <a href="http://twitter.com/matthiasshapiro/statuses/21674192747" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/josefajardo" class="aktt_username">josefajardo</a> Voting for suck-y candidates: I always thought that was a uniquely American problem. <a href="http://twitter.com/josefajardo/statuses/21698710481" class="aktt_tweet_reply">in reply to josefajardo</a> <a href="http://twitter.com/matthiasshapiro/statuses/21699374133" class="aktt_tweet_time">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/08/22/twitter-weekly-updates-for-2010-08-22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WrapPanel and DockPanel in Windows Phone 7 With Blend</title>
		<link>http://www.designersilverlight.com/2010/06/28/using-wrappanel-and-dockpanel-in-windows-phone-7-with-blend/</link>
		<comments>http://www.designersilverlight.com/2010/06/28/using-wrappanel-and-dockpanel-in-windows-phone-7-with-blend/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 04:30:59 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[DockPanel]]></category>
		<category><![CDATA[Panels]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[WrapPanel]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/2010/06/28/using-wrappanel-and-dockpanel-in-windows-phone-7-with-blend/</guid>
		<description><![CDATA[I’m currently working on porting the run-away hit mobile application ShopSavvy to Windows Phone 7 (sign up to be a beta tester) and one of the things I really wished I had was the WrapPanel. (For those who are new to Silverlight/WPF/Windows Phone 7, the WrapPanel stacks UI elements either horizontally or vertically like the [...]]]></description>
			<content:encoded><![CDATA[<p>I’m currently working on porting the run-away hit mobile application ShopSavvy to Windows Phone 7 (<a href="https://spur.wufoo.com/forms/shopsavvy-for-windows-phone-7/">sign up to be a beta tester</a>) and one of the things I really wished I had was the WrapPanel. </p>
<p>(For those who are new to Silverlight/WPF/Windows Phone 7, the WrapPanel stacks UI elements either horizontally or vertically like the StackPanel except that, when it hits the panel limit it… wait for it… wraps and starts stacking in a new column/row. Handy.)</p>
<p>I found a way to <a href="http://www.codebadger.com/blog/post/2010/03/20/Using-the-WrapPanel-from-the-Silverlight-Toolkit-on-Windows-Phone-7.aspx">add it with the Silverlight Toolkit</a>, but doing that added 140 Kb to my application. Maybe I’m just stuck in the world of J2ME, but adding 140 Kb to my mobile app isn’t OK if I can help it. I found <a href="http://www.designersilverlight.com/2010/06/28/using-wrappanel-and-dockpanel-in-windows-phone-7-with-blend/">this post from Jeff Wilcox</a> on adding the WrapPanel and that didn’t seem to work for me. (My comments are the whiny ones at the end of the post.)</p>
<p>But I finally got it working and I’ll tell you how. </p>
<p>Or I could just taunt you. That would be fun too. </p>
<p>Naw, I’m just kidding. Here’s the stuff you need.</p>
<p><a href="http://designersilverlight.com/wp-content/uploads/2010/06/WP7Panels.zip">Windows Phone 7 WrapPanel and DockPanel (Source</a>)</p>
<p><a href="http://designersilverlight.com/wp-content/uploads/2010/06/WP7PanelsDLL.zip">Windows Phone 7 WrapPanel and DockPanel (DLL)</a></p>
<p>All you have to do is download the DLL, unzip and reference in your app like so:</p>
<p>Right click on the “References” section of your project.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/06/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb.png" width="232" height="63" /></a>&#160;</p>
<p>Select the WP7Panels DLL from whatever folder you put it in and see it show up in your References</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb1.png" width="280" height="186" /></p>
<p>Open up the “Assets” section and type “wrap” or “dock” the wrap-or-dock panel should show up. Double click it or drag it onto the canvas to add it to your app. Blend will take care of the rest of the namespaces and everything. </p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/06/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb2.png" width="338" height="121" /></a>&#160;</p>
<p>And start adding items to your panel. It should work the way it’s supposed to work.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/06/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb3.png" width="175" height="217" /></a> <a href="http://www.designersilverlight.com/wp-content/uploads/2010/06/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb4.png" width="244" height="166" /></a></p>
<p>One note with the DockPanel… items placed in the DockPanel need to have the attached property</p>
<p><font color="#ff0000">[xmlns]:DockPanel.Dock</font>=”<font color="#0000ff">[something]</font>”</p>
<p>if you want them to do something other than align in the center. The [xmlns] name should be the same thing that is before the “DockPanel” in the XAML. It will most likely be “WP7Panels”. Therefore, the following XAML:</p>
<p><font color="#0000ff">&lt;</font><font color="#8b0000">WP7Panels:DockPanel</font><font color="#0000ff">&gt;</font>     <br />&#160;&#160;&#160; <font color="#0000ff">&lt;</font><font color="#800000">Button</font> <font color="#ff0000">Content</font>=&quot;<font color="#0000ff">Button</font>&quot; <font color="#ff0000">WP7Panels:DockPanel.Dock</font>=&quot;<font color="#0000ff">Bottom</font>&quot; <font color="#0000ff">/&gt;      <br /></font>&#160;&#160;&#160; <font color="#0000ff">&lt;</font><font color="#800000">Button</font> <font color="#ff0000">Content</font>=&quot;<font color="#0000ff">Button</font>&quot; <font color="#ff0000">WP7Panels:DockPanel.Dock</font>=&quot;<font color="#0000ff">Top</font>&quot; <font color="#0000ff">/&gt;      <br /></font>&#160;&#160;&#160; <font color="#0000ff">&lt;</font><font color="#800000">Button</font> <font color="#ff0000">Content</font>=&quot;<font color="#0000ff">Button</font>&quot; <font color="#ff0000">WP7Panels:DockPanel.Dock</font>=&quot;<font color="#0000ff">Right</font>&quot; <font color="#0000ff">/&gt;      <br /></font>&#160;&#160;&#160; <font color="#0000ff">&lt;</font><font color="#800000">Button</font> <font color="#ff0000">Content</font>=&quot;<font color="#0000ff">Button</font>&quot; <font color="#ff0000">WP7Panels:DockPanel.Dock</font>=&quot;<font color="#0000ff">Left</font>&quot; <font color="#0000ff">/&gt;      <br /></font>&#160;&#160;&#160; <font color="#0000ff">&lt;</font><font color="#800000">Button</font> <font color="#ff0000">Content</font>=&quot;<font color="#0000ff">Button</font>&quot; <font color="#0000ff">/&gt;      <br /><font color="#0000ff">&lt;/</font><font color="#8b0000">WP7Panels:DockPanel</font><font color="#0000ff">&gt;</font></font></p>
<p>…should look like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/06/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.designersilverlight.com/wp-content/uploads/2010/06/image_thumb5.png" width="397" height="321" /></a> </p>
<p align="left">If you want to add the actual files to your Windows Phone 7 app instead of just referencing the DLL (perhaps you are crazy or you have a deep and desperate need to fully understand absolutely everything you touch or you are a C++ developer), you can download the source. I’ve consolidated the DockPanel code into a single file (DockPanel.cs), but you’ll need the following files to get the WrapPanel working (<a href="http://designersilverlight.com/wp-content/uploads/2010/06/WP7Panels.zip">all included in the source</a>).</p>
<ul>
<li>LengthConverter.cs </li>
<li>NumericalExtensions.cs </li>
<li>OrientedSize.cs </li>
<li>TypeConverter.cs </li>
<li>WrapPanel.cs </li>
</ul>
<p>Finally, if you need something else for Windows Phone 7 from the Silverlight Toolkit, you can either add the entire toolkit (<a href="http://www.codebadger.com/blog/post/2010/03/20/Using-the-WrapPanel-from-the-Silverlight-Toolkit-on-Windows-Phone-7.aspx">explained here</a>) or download the <a href="http://silverlight.codeplex.com/SourceControl/changeset/changes/35261">source for the latest Silverlight 3 build</a> and open it in Visual Studio 2010 (for some reason, I couldn’t get it to open in Visual Studio 2008). It should update and you should be all set playing around in there to extract the stuff you need. </p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/06/28/using-wrappanel-and-dockpanel-in-windows-phone-7-with-blend/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Collection Of Windows Phone 7 Motion Videos</title>
		<link>http://www.designersilverlight.com/2010/06/18/a-collection-of-windows-phone-7-motions/</link>
		<comments>http://www.designersilverlight.com/2010/06/18/a-collection-of-windows-phone-7-motions/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 23:12:17 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[motion design]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Windows Phone 7]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=1026</guid>
		<description><![CDATA[In case you haven&#8217;t heard this before, this blog is basically a collection of things that I&#8217;ve learned and will almost certainly forget unless I write them down. Kind of a public short-term memory overflow. I&#8217;ve been working on motion flow design a lot and there is no better way to do motion flow design [...]]]></description>
			<content:encoded><![CDATA[<p>In case you haven&#8217;t heard this before, this blog is basically a collection of things that I&#8217;ve learned and will almost certainly forget unless I write them down. Kind of a public short-term memory overflow. I&#8217;ve been working on motion flow design a lot and there is no better way to do motion flow design than to look at cool interface animations.</p>
<p>I&#8217;m also doing some Windows Phone 7 design and I want to have a place to go to look at as many videos of Windows Phone 7 in action to figure out how to design an application motion flow that fits with the rest of the app. Watch these videos carefully and notice that pretty much everyone is doing something slightly different for their motion flow. The same navigation concepts are in place, but the motion flow is different for many of the apps.</p>
<p>So&#8230; here is my collection of Windows Phone 7 videos and animations.</p>
<p>From Engadget:</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="265" id="viddler"><param name="movie" value="http://www.viddler.com/simple_on_site/ee4dd83c" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="fake=1"/><embed src="http://www.viddler.com/simple_on_site/ee4dd83c" width="437" height="265" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" flashvars="fake=1" name="viddler" ></embed></object></p>
<p>(<a href="http://www.engadget.com/2010/02/15/windows-phone-7-series-hands-on-and-impressions/">more at the Engadget post</a>)</p>
<p>E-mail on the Windows Mobile 7 Phone</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/vy5raUgtwp4&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vy5raUgtwp4&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p>The AP application (by Archetype) (skip to 3:30)</p>
<p><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="444" height="288"><param name="source" value="http://channel9.msdn.com/App_Themes/default/VideoPlayer10_01_18.xap" /><param name="initParams" value="deferredLoad=true,duration=0,m=http://ecn.channel9.msdn.com/o9/ch9/7/3/4/7/3/5/MIX2010Key1APReader_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://ecn.channel9.msdn.com/o9/ch9/7/3/4/7/3/5/MIX2010Key1APReader_512_ch9.png, postid=537437" /><param name="background" value="#00FFFFFF" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
</a><br />
</object></p>
<p>Seesmic for Windows Phone 7 (skip to 6:40)</p>
<p><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="444" height="288"><param name="source" value="http://channel9.msdn.com/App_Themes/default/VideoPlayer10_01_18.xap" /><param name="initParams" value="deferredLoad=true,duration=0,m=http://ecn.channel9.msdn.com/o9/ch9/8/4/4/7/3/5/MIX2010Key1Seismic_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://www.windowsphone7.com/images/multimedia/Seismic_387x240.jpg, postid=0" /><param name="background" value="#00FFFFFF" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
</a><br />
</object></p>
<p>The marketplace hub</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/HrKCtuhGmqU&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/HrKCtuhGmqU&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></p>
<p>That&#8217;s all for me for now&#8230; I&#8217;ll try to update this with more examples later</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/06/18/a-collection-of-windows-phone-7-motions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://ecn.channel9.msdn.com/o9/ch9/7/3/4/7/3/5/MIX2010Key1APReader_ch9.wmv" length="18584727" type="video/x-ms-wmv" />
<enclosure url="http://ecn.channel9.msdn.com/o9/ch9/8/4/4/7/3/5/MIX2010Key1Seismic_ch9.wmv" length="60171331" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>Silverlight 4 Binding and StringFormat in XAML</title>
		<link>http://www.designersilverlight.com/2010/05/28/silverlight-4-binding-and-stringformat-in-xaml/</link>
		<comments>http://www.designersilverlight.com/2010/05/28/silverlight-4-binding-and-stringformat-in-xaml/#comments</comments>
		<pubDate>Fri, 28 May 2010 20:59:36 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[StringFormat]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=1010</guid>
		<description><![CDATA[I discovered this amazing feature almost by accident and it has made this one part of my design so much easier that I had to share it. A new feature in Silverlight 4 is the ability to using the StringFormat feature when binding. Previously, if I wanted to have a piece of text that said [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered this amazing feature almost by accident and it has made this one part of my design so much easier that I had to share it.</p>
<p>A new feature in Silverlight 4 is the ability to using the StringFormat feature when binding. Previously, if I wanted to have a piece of text that said “Your name is [username]” I could either use the old Horizontal-Stack-Panel-And-2-TextBlocks trick (as seen below)…<br />
<span style="font-family: Consolas; color: #0000ff;"> &lt;</span><span style="font-family: Consolas; color: #a31515;">StackPanel</span><span style="font-family: Consolas; color: #ff0000;"> Orientation</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;Horizontal&#8221;&gt;</span></span><span style="font-family: Consolas; color: #000000;"> </span> </span><br />
<span style="font-family: Consolas; color: #0000ff; ;"> <span style="font-family: Consolas; color: #a31515;"> </span><span style=";"><span style="font-family: Consolas; color: #0000ff;"> &lt;</span><span style="font-family: Consolas; color: #a31515;">TextBlock</span><span style="font-family: Consolas; color: #ff0000;"> Text</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;Your name is&#8221;</span><span style="font-family: Consolas; color: #ff0000;"> Margin</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;0,0,4,0&#8243;/&gt;</span></span><span style="font-family: Consolas; color: #000000;"> </span><br />
<span style="font-family: Consolas; color: #0000ff;"> &lt;</span><span style="font-family: Consolas; color: #a31515;">TextBlock</span><span style="font-family: Consolas; color: #ff0000;"> Text</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;<span style="color: #b8860b;">{</span></span><span style="color: #b8860b;"><span style="font-family: Consolas;">Binding</span><span style="font-family: Consolas;"> username</span></span><span style="font-family: Consolas; color: #0000ff;"><span style="color: #b8860b;">}</span>&#8220;/&gt;</span></span></span><br />
<span style="font-family: Consolas; color: #0000ff; ;"> <span style=";"><span style="font-family: Consolas; color: #0000ff;">&lt;/</span><span style="font-family: Consolas; color: #a31515;">StackPanel</span><span style="font-family: Consolas; color: #0000ff;">&gt;</span></p>
<p>…or write a value converter (not going to be seen below because there’s <a href="http://timheuer.com/blog/archive/2008/07/30/format-data-in-silverlight-databinding-valueconverter.aspx">a great example of it over here</a>. Incidentally, that example is totally irrelevant if you’re going to use StringFormat, but more on that in a second).</p>
<p>The StringFormat option in Silverlight 4 allows you put all that information into a single field, which is extremely useful not only for TextBlocks, but for Content fields in a Button. In fact, let’s use that as an example.</p>
<p>Let’s say you want to create a Button to log out, so you want it to say “Log Out of &lt;Username&gt; Account”. (A bit clumsy, but the technique is the important part.) All you would have to do is the following:</p>
<p><span style="font-family: Consolas; color: #0000ff; font-size:small;"><span style="font-size:small;">&lt;</span><span style="font-size: small;"><span style="font-family: Consolas; color: #a31515;">Button</span><span style="font-family: Consolas; color: #ff0000;"> Content</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;<span style="color: #b8860b;">{</span></span><span style="color: #b8860b;"><span style="font-family: Consolas;">Binding</span><span style="font-family: Consolas;"> username</span><span style="font-family: Consolas;">,</span><span style="font-family: Consolas;"> StringFormat</span></span><span style="font-family: Consolas; color: #0000ff;"><span style="color: #b8860b;">=’Log Out of \{0\} Account’}</span>&#8220;/&gt;</span></span></span></p>
<p>This gets even better for things like number formatting. Let’s say we want the user to enter an amount of money (for example, $1,593.29) into a TextBox (maybe in a PayPal application). If we have bound that value to a numeric format, we can express that format through binding and when the TextBox loses focus, the StringFormat will take the number entered and format in a currency format.</p>
<p><span style="font-family: Consolas; color: #0000ff; "><span>&lt;</span><span ><span style="font-family: Consolas; color: #a31515;">TextBox</span><span style="font-family: Consolas; color: #ff0000;"> </span><span style="font-family: Consolas; color: #ff0000;">Text</span><span style="font-family: Consolas; color: #0000ff;">=&#8221;<span style="color: #b8860b;">{</span></span><span style="color: #b8860b;"><span style="font-family: Consolas;">Binding</span><span style="font-family: Consolas;"> paymentAmount</span><span style="font-family: Consolas;">,</span><span style="font-family: Consolas;"> StringFormat</span><span style="font-family: Consolas;">=</span><span style="font-family: Consolas;">\</span><span style="font-family: Consolas;">{</span><span style="font-family: Consolas;">0</span><span style="font-family: Consolas;">:</span><span style="font-family: Consolas;">C2</span><span style="font-family: Consolas;">\</span></span><span style="font-family: Consolas; color: #0000ff;"><span style="color: #b8860b;">}}</span>&#8220;</span><span style="font-family: Consolas; color: #0000ff;">/&gt;</span></span></span></p>
<p>The only issue with numerical and date formats is they the MUST be bound to a number or date.</p>
<p>With that in mind, here is a sampling of StringFormat options, stolen mostly from <a href="http://blogs.msdn.com/b/kathykam/archive/2006/03/29/564426.aspx">Kathy Kam</a>. For more complete options, check out the <a href="http://msdn.microsoft.com/en-us/library/26etazsy%28v=VS.100%29.aspx">MSDN articles on String.Format</a> and trial-and-error your way through things. If you want to play around with this, <a href='http://www.designersilverlight.com/wp-content/uploads/2010/05/SL4StringFormatExample.zip'>download my StringFormat project</a> or look at the Silverlight sample app at the bottom of this page.</p>
<h3>Strings</h3>
<p>For a string with the value “Silverlight”</p>
<p>Using \{0\,#\} effectively forces the string to be at least # characters long, using spaces to pad it to the requested length.</p>
<p><span style="color: #b8860b;">StringFormat=\{0\,20\}</span> : “ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Silverlight”<br />
<span style="color: #b8860b;">StringFormat=\{0\,-20\}</span> : “Silverlight &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;”<br />
<span style="color: #b8860b;">StringFormat=&#8217;I just typed &amp;quot;\{0\}&amp;quot;.&#8217;</span> : “I just typed “Silverlight&#8221;.”</p>
<p><a href="http://msdn.microsoft.com/en-us/library/txafckwd%28v=VS.100%29.aspx">MSDN article on Composite Formatting</a></p>
<h3>Numbers</h3>
<p>For a double with the value : “38293.53”</p>
<p><span style="color: #b8860b;">StringFormat=c</span> : “$38,293.53” – Use ‘c’ for currency<br />
<span style="color: #b8860b;">StringFormat=e</span> : “3.829353e+004” – Use ‘e’ for exponential (scientific)<br />
<span style="color: #b8860b;">StringFormat=n </span>: “38,293.53” &#8211; Use n for number</p>
<p>You can also use these in the following format:</p>
<p><span style="color: #b8860b;">\{0:(letter)(number)\}</span></p>
<p>where (number) indicates how many decimal places there should be. The format will use standard rounding rules to determine the last digit. For example:</p>
<p><span style="color: #b8860b;">StringFormat=\{0:c0\}</span> : “$38,294”<br />
<span style="color: #b8860b;">StringFormat=\{0:n4\} </span>: “38,293.5300”<br />
<span style="color: #b8860b;">StringFormat=You have \{0:c1\}</span> : “You have $38,293.5”</p>
<p><a href="http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx">MSDN article for standard number formatting</a><br />
<a href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx">MSDN article for custom number formatting</a></p>
<h3>Dates</h3>
<p>The date formatting has a huge range of options.</p>
<p>For the DateTime of “April 17, 2004, 1:52:45 PM”</p>
<p>You can either use a set of standard formats (standard formats)…<br />
<span style="color: #b8860b;">StringFormat=f</span> : “Saturday, April 17, 2004 1:52 PM”<br />
<span style="color: #b8860b;">StringFormat=g</span> : “4/17/2004 1:52 PM”<br />
<span style="color: #b8860b;">StringFormat=m </span>: “April 17”<br />
<span style="color: #b8860b;">StringFormat=y</span> : “April, 2004”<br />
<span style="color: #b8860b;">StringFormat=t</span> : “1:52 PM”<br />
<span style="color: #b8860b;">StringFormat=u </span>: “2004-04-17 13:52:45Z”<br />
<span style="color: #b8860b;">StringFormat=o </span>: “2004-04-17T13:52:45.0000000”</p>
<p>… or you can create your own date formatting using letters (custom formats)</p>
<p><span style="color: #b8860b;">StringFormat=’MM/dd/yy’</span> : “04/17/04”<br />
<span style="color: #b8860b;">StringFormat=’MMMM dd, yyyy g’</span> : “April 17, 2004 A.D.”<br />
<span style="color: #b8860b;">StringFormat=&#8217;hh:mm:ss.fff tt&#8217; </span>: “01:52:45.000 PM”</p>
<p><a href="http://msdn.microsoft.com/en-us/library/az4se3k1.aspx">MDSN article for standard date formatting</a><br />
<a href="http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx">MSDN article for custom date formatting</a></p>
<h3>Sample App</h3>
<div id="silverlightControlHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="700px" height="533px"><param name="source" value="http://www.designersilverlight.com/SilverlightSamples/SL4StringFormatExample.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="4.0.50401.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=4.0.50401.0" style="text-decoration: none;"><br />
				<img src="http://go.microsoft.com/fwlink/?LinkID=161376" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
			</a><br />
		</object><iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/05/28/silverlight-4-binding-and-stringformat-in-xaml/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Free Chapter From Beautiful Visualization</title>
		<link>http://www.designersilverlight.com/2010/05/27/free-chapter-from-beautiful-visualization/</link>
		<comments>http://www.designersilverlight.com/2010/05/27/free-chapter-from-beautiful-visualization/#comments</comments>
		<pubDate>Thu, 27 May 2010 16:06:58 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Beautiful Visualization]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[free e-book]]></category>
		<category><![CDATA[Matthias Shapiro]]></category>
		<category><![CDATA[O'Reilly Media]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=999</guid>
		<description><![CDATA[OK, Cory Doctorow, let&#8217;s see if this works. I&#8217;ve recently written a chapter on storytelling and information visualization for O&#8217;Reilly media to publish in the book Beautiful Visualization. And you can read it for free. download: Download Once Upon A Stacked Time Series - Matthias Shapiro (689.54KB) You can buy the e-book or per-order Beautiful [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.forbes.com/2006/11/30/cory-doctorow-copyright-tech-media_cz_cd_books06_1201doctorow.html">OK, Cory Doctorow, let&#8217;s see if this works</a>.</p>
<p>I&#8217;ve recently written a chapter on storytelling and information visualization for O&#8217;Reilly media to publish in the book Beautiful Visualization.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/BeautifulVisualizationThumb.jpg"><img class="alignnone size-full wp-image-1003" title="BeautifulVisualizationThumb" src="http://www.designersilverlight.com/wp-content/uploads/2010/05/BeautifulVisualizationThumb.jpg" alt="" width="208" height="273" /></a></p>
<p>And you can read it for free.<br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.designersilverlight.com/wp-content/plugins/downloads-manager/img/icons/pdf.gif" alt="http://www.designersilverlight.com/wp-content/plugins/downloads-manager/img/icons/pdf.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.designersilverlight.com/?file_id=1">Download Once Upon A Stacked Time Series - Matthias Shapiro</a> <small>(689.54KB)</small><br />
    </td>
  </tr>
</table></p>
<p>You can buy the <a href="http://oreilly.com/catalog/0636920000617/">e-book or per-order  Beautiful Visualization directly from O&#8217;Reilly media</a> or pre-order a hard copy of <a href="http://www.amazon.com/gp/product/1449379869?ie=UTF8&#038;tag=irrationalopt-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1449379869">Beautiful Visualization from Amazon</a></p>
<h2>Quick Summary</h2>
<p>Information visualization is a powerful medium for the communication of data, but one of the things that makes it so powerful is the fact that it plays a part in the larger story of reality. Information visualizations can tell the part of the story that is data heavy in a way that is gripping and memorable. The first half of my chapter walks through the process of creating a visualization and the importance of anchoring that visualization in the context of a larger story (including some thought-experiment examples).</p>
<p>The second half of the chapter walks through the entire process of creating an information visualization, from data gathering to munging (sorting, filtering, re-aligning) a large data set, to visual representation. This visualization is done using Microsoft Excel (you could use <a href="http://docs.google.com/">Google Docs, which is free</a>) and Adobe Photoshop (you could use <a href="http://www.gimp.org/">GIMP, which is free</a>).</p>
<p>If you like my chapter, you will love the whole book. Beautiful Visualization is twenty chapters of unadulterated awesome visualization tips, tricks, discussions, and lessons from scientists, artists and visualization experts. Once again, your purchase options are to buy the <a href="http://oreilly.com/catalog/0636920000617/">e-book or per-order Beautiful Visualization directly from O&#8217;Reilly media</a> or pre-order a hard copy of <a href="&lt;a href=">Beautiful Visualization from Amazon</a>.</p>
<p>Finally, if you&#8217;re one of those people who is constantly thinking &#8220;I really wish I could financially support someone who is soooooo awesome that they put their professional work online for free&#8221;, today is your lucky day. You can donate whatever you would like directly to me as a thank you via PayPal.</p>
<input name="hosted_button_id" type="hidden" value="TUJZTJFUPRSYE" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" type="image" />
<p>But, most of all, read my chapter! Comment on it, tear it to shreds, pick out the good parts, pick out the bad parts, print it out and light it on fire. I hope it will be helpful in whatever you&#8217;re doing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/05/27/free-chapter-from-beautiful-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP, MySQL, and Silverlight: The Complete Tutorial (Part 3)</title>
		<link>http://www.designersilverlight.com/2010/05/24/php-mysql-and-silverlight-the-complete-tutorial-part-3/</link>
		<comments>http://www.designersilverlight.com/2010/05/24/php-mysql-and-silverlight-the-complete-tutorial-part-3/#comments</comments>
		<pubDate>Mon, 24 May 2010 19:30:58 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Binding]]></category>
		<category><![CDATA[Data Binding]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[eventtrigger]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=970</guid>
		<description><![CDATA[This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”. Here is an example of the finished product (I reserve the right to clean up the data on a regular basis): [...]]]></description>
			<content:encoded><![CDATA[<p>This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”. Here is an example of the finished product (I reserve the right to clean up the data on a regular basis):</p>
<div id="silverlightControlHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500px" height="300px"><param name="source" value="http://designersilverlight.com/Silverlight/ToDo_List_Tutorial.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=3.0.40818.0" style="text-decoration: none;"><br />
				<img src="http://go.microsoft.com/fwlink/?LinkID=161376" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
			</a><br />
		</object><iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
<p><a href="http://www.designersilverlight.com/2010/05/22/php-mysql-and-silverlight-the-complete-tutorial-part-1/">Part 1: MySQL</a></p>
<p><a href="http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-2/">Part 2: PHP</a></p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/AllFiles_PHP_and_Silverlight.zip">Download all files (PHP &#038; Silverlight)</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/PHP_Tutorial_Files.zip">Download PHP files only</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/ToDo_List_Tutorial.zip">Download Silverlight project only</a></p>
<p>In Part 1, we created the MySQL tables necessary to store data for a simple to-do list. In Part 2, we wrote a PHP service to deliver the items in our to-do list in JSON format. In Part 3, we’ll create a Silverlight application that can utilize this web service to retrieve, display, and edit the to-do list.</p>
<h2>Part 3: Connecting Silverlight To Our PHP Web Service</h2>
<p>First, let’s start a new Silverlight project. (You can download the full project here.) In the interest of time, I’m not going to go into the details of the “ideal” implementation for this. I’m just going to show the parts necessary to retrieve, display and interact with the to-do data.</p>
<p>Before we start with the UI, let’s build a model so that we can appropriately bind our data. Add a new folder to the Silverlight project and name it “Models”. Add a new class to it and name the class “ToDoItem.cs”. In this instance, we’re just going to make the model look just like our MySQL table.</p>
<p><strong>ToDoItem.cs</strong></p>
<p><span style="color: #0000ff; font-size: small;"> </span></p>
<p><span style="color: #0000ff; font-size: small;"><span style="font-family: Consolas;">p<span style="font-size: small;">ublic </span></span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;">class</span><span style="color: #000000;"> </span><span style="color: #2b91af;">ToDoItem</span></span></span><br />
<span style="font-family: Consolas; font-size: small;">{<br />
</span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">bool</span><span style="color: #000000;"> isDone { </span><span style="color: #0000ff;">get</span><span style="color: #000000;">; </span><span style="color: #0000ff;">set</span></span></span><span style="color: #000000;"><span style="font-family: Consolas; font-size: small;">; }</span></span><br />
<span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;"> public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">string</span><span style="color: #000000;"> toDoDescription {</span><span style="color: #0000ff;">get</span><span style="color: #000000;">; </span><span style="color: #0000ff;">set</span></span></span><span style="color: #000000;"><span style="font-family: Consolas; font-size: small;">;}</span></span><br />
<span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;"> public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> toDoID {</span><span style="color: #0000ff;">get</span><span style="color: #000000;">; </span><span style="color: #0000ff;">set</span></span></span><span style="color: #000000;"><span style="font-family: Consolas; font-size: small;">;}</span></span><br />
<span style="font-family: Consolas; color: #0000ff; font-size: small;"><br />
public</span><span style="color: #000000;"><span style="font-family: Consolas; font-size: small;"> ToDoItem()</span></span> <span style="font-family: Consolas; font-size: small;">{ </span><span style="font-family: Consolas; font-size: small;">}<br />
</span><span style="font-family: Consolas; font-size: small;">}</span></span></p>
<p><span style="color: #0000ff; font-size: small;"><span style="font-family: Consolas; font-size: small;"> </span></span></p>
<p><span style="color: #0000ff; font-size: small;"> </span></p>
<p>Now, we’ll add to our MainPage.xaml a ListBox named “ToDoList” that will hold the to-do items and a Grid to house the UI to add a new to-do. We’ll work on gathering and displaying our items first.</p>
<p>Right-click on the ListBox and go to “<strong>Edit Additional Templates –&gt; Edit Generated Items (ItemTemplate) –&gt; Create Empty…</strong>”<br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0012.png"><img style="display: inline; border-width: 0px;" title="clip_image001" src="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image001_thumb2.png" border="0" alt="clip_image001" width="634" height="94" /></a><br />
You’ll love this part… Just add a checkbox to it. That’s all we’ll need, so that’s all we’ll add. Then, go into the XAML and make the checkbox look like this:</p>
<p><span style="color: #0000ff; font-size: small;"> </span></p>
<p><span style="color: #0000ff; font-size: small;"><span style="font-family: Consolas; font-size: small;">&lt;</span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #a31515;">CheckBox</span><span style="color: #ff0000;"> Content</span><span style="color: #0000ff;">=&#8221;{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> toDoDescription</span><span style="color: #0000ff;">}&#8221;<br />
</span></span></span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #ff0000;"> IsChecked</span><span style="color: #0000ff;">=&#8221;{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> isDone</span><span style="color: #0000ff;">}&#8221;</span></span></span><span style="color: #000000;"> </span><br />
<span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #ff0000;"> Tag</span><span style="color: #0000ff;">=&#8221;{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> toDoID</span><span style="color: #0000ff;">}&#8221; /&gt;</span></span></span></span></p>
<p><span style="color: #0000ff; font-size: small;"> </span></p>
<p><span style="font-family: Consolas; color: #0000ff; font-size: small;"> </span></p>
<p>This binding is all we’ll need once we gather our to-dos from the web service and attach it to the ListBox. Let’s go ahead and get that data into this ListBox.</p>
<p>Open MainPage.xaml.cs and, at the top of the class, add:</p>
<p><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #2b91af;">WebClient</span><span style="color: #000000;"> wc = </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #2b91af;">WebClient</span></span></span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #000000;">();<br />
</span><span style="color: #2b91af;">ObservableCollection</span><span style="color: #000000;">&lt;</span><span style="color: #2b91af;">ToDoItem</span><span style="color: #000000;">&gt; myToDoList = </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #2b91af;">ObservableCollection</span><span style="color: #000000;">&lt;</span><span style="color: #2b91af;">ToDoItem</span></span></span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #000000;">&gt;();<br />
</span><span style="color: #0000ff;">string</span><span style="color: #000000;"> baseURI = </span><span style="color: #a31515;">&#8220;http://&lt;Web_address_holding_your_php_files&gt;&#8221;</span><span style="color: #000000;">;</span></span></span></p>
<p>You may have to add “using System.Net;” and “using System.Collections.ObjectModel;” to the top of the file. While we’re adding references, right-click on the “References” folder and find the “System.Json” component and add it to the project. Then add “using System.Json;” to the references section in the top.  It’ll come in handy in a minute.</p>
<p>In the MainPage() method under InitializeComponent(), type “wc.DownloadStringCompleted += “ and hit TAB twice. This will add an event handler for when the WebClient has finished connecting to the web service we wrote.</p>
<p>The resulting event handler (which should be named “wc_DownloadStringCompleted”), is the code that our application will go to whenever it makes a call to our web service and gets a result. In it, we will do the following things:</p>
<ol>
<li>Check to make sure we got a result without error</li>
<li>Check to see what kind of result we got (did we get all to-do items? or add a new to-do item?)</li>
<li>Walk through the result, extracting the data we need</li>
<li>Apply that data to the UI</li>
</ol>
<p>Let’s add the code to do that for getting all the items. Make your event handler look like this:</p>
<div id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:7934bf62-c08c-435e-980b-d18700e35c2b" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;">wc_DownloadStringCompleted</div>
<div style="background: #ddd; max-height: 400px; overflow: auto;">
<ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;">
<li><span style="color: #0000ff;">void</span> wc_DownloadStringCompleted(<span style="color: #0000ff;">object</span> sender, <span style="color: #2b91af;">DownloadStringCompletedEventArgs</span> e)</li>
<li style="background: #f3f3f3;"> {</li>
<li> <span style="color: #0000ff;">if</span> (e.Error == <span style="color: #0000ff;">null</span> &amp;&amp; e.Result!= <span style="color: #a31515;">&#8220;&#8221;</span>)</li>
<li style="background: #f3f3f3;"> {</li>
<li> <span style="color: #2b91af;">JsonValue</span> completeResult = <span style="color: #2b91af;">JsonPrimitive</span>.Parse(e.Result);</li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">string</span> resultType = completeResult[<span style="color: #a31515;">"returnType"</span>].ToString().Replace(<span style="color: #a31515;">&#8216;&#8221;&#8216;</span>, <span style="color: #a31515;">&#8216; &#8216;</span>).Trim();</li>
<li> <span style="color: #0000ff;">if</span> (resultType == <span style="color: #a31515;">&#8220;todoItems&#8221;</span>)</li>
<li style="background: #f3f3f3;"> {</li>
<li> myToDoList.Clear();</li>
<li style="background: #f3f3f3;"></li>
<li> <span style="color: #2b91af;">JsonArray</span> toDoItemsJson = (<span style="color: #2b91af;">JsonArray</span>)completeResult[<span style="color: #a31515;">"results"</span>];</li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">foreach</span> (<span style="color: #2b91af;">JsonValue</span> todoItemJson <span style="color: #0000ff;">in</span> toDoItemsJson)</li>
<li> {</li>
<li style="background: #f3f3f3;"> <span style="color: #2b91af;">ToDoItem</span> thisTodo = <span style="color: #0000ff;">new</span> <span style="color: #2b91af;">ToDoItem</span>();</li>
<li></li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">if</span> (todoItemJson[<span style="color: #a31515;">"ToDoIndex"</span>] != <span style="color: #0000ff;">null</span>)</li>
<li> thisTodo.toDoID = <span style="color: #2b91af;">Convert</span>.ToInt32(todoItemJson[<span style="color: #a31515;">"ToDoIndex"</span>].ToString().Replace(<span style="color: #a31515;">&#8216;&#8221;&#8216;</span>, <span style="color: #a31515;">&#8216; &#8216;</span>).Trim());</li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">if</span> (todoItemJson[<span style="color: #a31515;">"TodoText"</span>] != <span style="color: #0000ff;">null</span>)</li>
<li> thisTodo.toDoDescription = todoItemJson[<span style="color: #a31515;">"TodoText"</span>].ToString().Replace(<span style="color: #a31515;">&#8216;&#8221;&#8216;</span>, <span style="color: #a31515;">&#8216; &#8216;</span>).Trim();</li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">if</span> (todoItemJson[<span style="color: #a31515;">"IsDone"</span>] != <span style="color: #0000ff;">null</span>)</li>
<li> {</li>
<li style="background: #f3f3f3;"> <span style="color: #0000ff;">int</span> isDoneInt =  <span style="color: #2b91af;">Convert</span>.ToInt32(todoItemJson[<span style="color: #a31515;">"IsDone"</span>].ToString().Replace(<span style="color: #a31515;">&#8216;&#8221;&#8216;</span>, <span style="color: #a31515;">&#8216; &#8216;</span>).Trim());</li>
<li> <span style="color: #0000ff;">if</span>(isDoneInt == 0){</li>
<li style="background: #f3f3f3;"> thisTodo.isDone = <span style="color: #0000ff;">false</span>;</li>
<li> } <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> (isDoneInt == 1){</li>
<li style="background: #f3f3f3;"> thisTodo.isDone = <span style="color: #0000ff;">true</span>;</li>
<li> }</li>
<li style="background: #f3f3f3;"> }</li>
<li> myToDoList.Add(thisTodo);</li>
<li style="background: #f3f3f3;"> }</li>
<li> ToDoList.ItemsSource = myToDoList;</li>
<li style="background: #f3f3f3;"> }</li>
<li> }</li>
<li style="background: #f3f3f3;"> }</li>
</ol>
</div>
</div>
</div>
<p>With this in place, all we need to do is make a call to the get_todo_items.php, which we can do by adding this code just below the wc.DownloadStringCompleted line in the MainPage() method.</p>
<p><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #000000;">wc.DownloadStringAsync(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #2b91af;">Uri</span><span style="color: #000000;">(baseURI + </span><span style="color: #a31515;">&#8220;get_todo_items.php&#8221;</span><span style="color: #000000;">));</span></span></span></p>
<p>When we run the project, we should get all objects from our database and the results should show up just the way we want in our Silverlight application. We will follow the exact same model to add new to-do items and update the to-do items we already have.</p>
<p>I’m in the process of separating out the final part of this tutorial (adding and updating the items) into a supplemental post so that I can wrap this post up. I encourage anyone walking through this to try to complete those parts by yourself and refer to the last bit only if you get stuck.</p>
<p>Finally, a little bit of warning. I structured this project to get it working in as straightforward a manner as possible. It is not in any way the ideal architectural example for a data-driven Silverlight application. It’s just a good way to get started using Silverlight in an environment that isn’t 100% Microsoft technologies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/05/24/php-mysql-and-silverlight-the-complete-tutorial-part-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP, MySQL, and Silverlight: The Complete Tutorial (Part 2)</title>
		<link>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-2/</link>
		<comments>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-2/#comments</comments>
		<pubDate>Mon, 24 May 2010 00:07:35 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=964</guid>
		<description><![CDATA[This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”. Here is an example of the finished product (I reserve the right to clean up the data on a regular basis): [...]]]></description>
			<content:encoded><![CDATA[<p>This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”.</p>
<p>Here is an example of the finished product (I reserve the right to clean up the data on a regular basis):</p>
<div id="silverlightControlHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500px" height="300px"><param name="source" value="http://designersilverlight.com/Silverlight/ToDo_List_Tutorial.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=3.0.40818.0" style="text-decoration: none;"><br />
				<img src="http://go.microsoft.com/fwlink/?LinkID=161376" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
			</a><br />
		</object><iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
<p><a href="http://www.designersilverlight.com/2010/05/22/php-mysql-and-silverlight-the-complete-tutorial-part-1/">Part 1: MySQL</a></p>
<p><a href="http://www.designersilverlight.com/2010/05/24/php-mysql-and-silverlight-the-complete-tutorial-part-3/">Part 3: Silverlight</a></p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/AllFiles_PHP_and_Silverlight.zip">Download all files (PHP &#038; Silverlight)</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/PHP_Tutorial_Files.zip">Download PHP files only</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/ToDo_List_Tutorial.zip">Download Silverlight project only</a></p>
<p>In Part 1, we created the MySQL tables necessary to store data for a simple to-do list. In Part 2, we’ll write some PHP code that will give us the ability to grab the data out of the database and send it, in JSON format, to our Silverlight application.</p>
<h2>Part 2: Writing the PHP Web Service</h2>
<p>We’re going to create 4 PHP files (<a href="../wp-content/uploads/2010/05/PHP_Tutorial_Files.zip">download  php files</a>):</p>
<ul>
<li>mysql_vars.php – holds all the information for connecting to the MySQL database</li>
<li>get_todo_items.php – for getting all the to do items</li>
<li>add_todo_item.php – adds a to do item</li>
<li>change_status.php – changes a to-do item from “not done” to “done” or vice versa</li>
</ul>
<p>Since all these projects will be using the information in mysql_vars.php, we’ll write that first.</p>
<p><strong>mysql_vars.php</strong></p>
<p><span style="color: #ff0000;">&lt;?php</span><br />
$dbUsername = &#8220;<span style="color: #cc0000;">[my_database_username]</span>&#8220;;<br />
$dbPassword = &#8220;<span style="color: #cc0000;">[my_database_password]</span>&#8220;;<br />
$db = &#8220;<span style="color: #cc0000;">[my_database_name]</span>&#8220;;<br />
$server = &#8220;<span style="color: #cc0000;">[my_database_server]</span>&#8220;;</p>
<p><span style="color: #ff9900;"> //To Do Table and Column Names</span><br />
$mysql_todoTable  = &#8220;<span style="color: #cc0000;">to_do_data</span>&#8220;;<br />
$mysql_todoIndexCol = &#8220;<span style="color: #cc0000;">index_key</span>&#8220;;<br />
$mysql_isDoneCol = &#8220;<span style="color: #cc0000;">is_done</span>&#8220;;<br />
$mysql_todoTextCol = &#8220;<span style="color: #cc0000;">to_do_text</span>&#8220;;</p>
<p>$connection = <span style="color: #0000ff;">mysql_connect</span>($server, $dbUsername, $dbPassword);</p>
<p><span style="color: #0000ff;"> function</span> formatInput($rawURLData)<br />
{<br />
$returnString = <span style="color: #0000ff;">urldecode</span>($rawURLData);<br />
$returnString = <span style="color: #0000ff;">mysql_real_escape_string</span>($returnString);<br />
<span style="color: #006600;">return</span> $returnString;<br />
}<br />
<span style="color: #ff0000;">?&gt;</span></p>
<p>We’ve added the to-do table and column names so that, if we decide to change anything later, we can just go to this file and update the table or column once.</p>
<p>Just for good measure, we’ve added a function we’ll want to use across our php files. The function “formatInput” will be used to make sure all our data is decoded from the URL that calls our web service (the urldecode method) and then try to block any SQL injections (the mysql_real_escape_string method).</p>
<p>Now, let’s write the basic “Get the data” file. What we’re going to do is write it so that the we can choose to get:</p>
<ul>
<li>all the to-do items</li>
<li>all the to-do items that are “done”</li>
<li>all the to-do items that are “not done”</li>
</ul>
<p>This range of functionality isn’t even close to ideal. In a perfect world, we would want a wider range of options in gathering items (for example, items that contain a certain word or one item in particular or limit the number of items we call by a date range). However, for our very simple purposes, this will do.</p>
<p>The way our web service will work is that we have a URL that we’ll call from Silverlight when we want to get some data. When we calls this web service, we may want only the &#8220;not done&#8221; items or only the &#8220;done&#8221; items. We&#8217;ll handle that option by adding &#8220;?itemStatus=done&#8221; or &#8220;?itemStatus=notDone&#8221; to the end of the URL.</p>
<p>Example: if our base URL is</p>
<p><a href="http://www.mywebsite.com/">http://www.mywebsite.com/</a></p>
<p>the call to</p>
<p><a href="http://www.mywebsite.com/get_todo_items.php">http://www.mywebsite.com/get_todo_items.php</a></p>
<p>will get all items, regardless of their completed status while</p>
<p><a href="http://www.mywebsite.com/get_todo_items.php?itemStatus=done">http://www.mywebsite.com/get_todo_items.php?itemStatus=done</a></p>
<p>will get all the to do items that are complete. So we need to make sure that our web service responds appropriately to both calls.</p>
<p>There are comments in the code, but I&#8217;ll just explain the basic concept in picture form:</p>
<p>We take in a URL, extract the variables from it, create the MySQL query based on the variables, execute the MySQL query, extract the results, and then send back the php object encoded as a Json object. Each one of our files will follow this same pattern.</p>
<p><strong>get_todo_items.php</strong></p>
<p><span style="color: #ff0000;">&lt;?</span><br />
<span style="color: #008000;"> include</span> <span style="color: #cc0000;">&#8216;mysql_vars.php&#8217;</span>;</p>
<p><span style="color: #ff9900;"> //    set up the &#8220;itemStatus&#8221; URL option and build a query addition<br />
//        to account for the itemStatus variable<br />
</span>$itemStatus = <span style="color: #0066ff;">$_GET</span>[<span style="color: #cc0000;">'itemStatus'</span>];<br />
$itemQueryAddition = &#8220;&#8221;;</p>
<p><span style="color: #008000;"> if</span>($itemStatus <span style="color: #0000ff;">!=</span> <span style="color: #008000;">NULL</span>)<br />
{<br />
<span style="color: #008000;"> if</span>($itemStatus <span style="color: #0000ff;">==</span> <span style="color: #cc0000;">&#8220;done&#8221;</span>)<br />
{<br />
$itemQueryAddition = <span style="color: #cc0000;">&#8220;WHERE `$mysql_isDoneCol` = 1&#8243;</span>;<br />
} <span style="color: #008000;">else if</span> ($itemStatus == <span style="color: #cc0000;">&#8220;notDone&#8221;</span>)<br />
{<br />
$itemQueryAddition = <span style="color: #cc0000;">&#8220;WHERE `$mysql_isDoneCol` = 0&#8243;</span>;<br />
}</p>
<p><span style="color: #ff9900;"> // Construct our MySQL query</span><br />
$todoQuery = <span style="color: #cc0000;">&#8220;SELECT * FROM `$mysql_todoTable` $itemQueryAddition ;&#8221;</span>;</p>
<p><span style="color: #ff9900;"> // execute the query and gather the results&#8230;</span><br />
<span style="color: #0000ff;">mysql_select_db</span>($db, $connection);<br />
$todoResult =<span style="color: #0000ff;"> mysql_query</span>($todoQuery);<br />
$todoArray = <span style="color: #0000ff;">array()</span>;</p>
<p><span style="color: #008000;"> while</span>($itemRow <span style="color: #0000ff;">= mysql_fetch_array</span>($todoResult))<br />
{<br />
$todoArray<span style="color: #0000ff;">[] = array(</span> <span style="color: #cc0000;">&#8220;ToDoIndex&#8221;</span> <span style="color: #0000ff;">=&gt;</span> $itemRow[<span style="color: #cc0000;">'index_key'</span>],<br />
<span style="color: #cc0000;">&#8220;IsDone&#8221;</span> <span style="color: #0000ff;">=&gt;</span> $itemRow[<span style="color: #cc0000;">'is_done'</span>],<br />
<span style="color: #cc0000;">&#8220;TodoText&#8221;</span> <span style="color: #0000ff;">=&gt;</span> $itemRow[<span style="color: #cc0000;">'to_do_text'</span>] );<br />
}<br />
<span style="color: #0000ff;">mysql_close</span>($connection);</p>
<p><span style="color: #ff9900;"> // &#8230; then encode the results as JSON Text&#8230;<br />
//   we&#8217;re using a &#8220;returnType&#8221; field so that our Silverlight application can differentiate between<br />
//   the kind of return values it recieves and parse the Json object appropriately</span></p>
<p>$returnItems = <span style="color: #0000ff;">array(</span> <span style="color: #cc0000;">&#8220;returnType&#8221;</span> =&gt; &#8220;todoItems&#8221;,<br />
<span style="color: #cc0000;">&#8220;results&#8221;</span> =&gt; $returnItems);<br />
$JSONResult = json_encode($todoArray);</p>
<p><span style="color: #ff9900;"> // &#8230; and print the results so that our app can read them<br />
</span> <span style="color: #0000ff;">echo</span> $JSONResult;<br />
<span style="color: #ff0000;">?&gt;</span></p>
<p>The other two files,<strong> add_todo_item.php</strong> and <strong>change_status.php</strong> use exactly the same structure to add a new item and change the status of an existing item (respectively). I won’t put all the code here in this post that is already too long, but you can download all the files here.</p>
<p>Update the mysql_vars.php file to fit your needs and you should be able to just upload these files and have your running to-do web service all ready for Silverlight to call it for data, which is something we’ll deal with in Part 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP, MySQL and Silverlight: The Complete Tutorial (Part 1)</title>
		<link>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-1/</link>
		<comments>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-1/#comments</comments>
		<pubDate>Sun, 23 May 2010 18:56:25 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/?p=960</guid>
		<description><![CDATA[This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”. This tutorial is geared toward someone who has never done databases or web services. Here is an example of the finished [...]]]></description>
			<content:encoded><![CDATA[<p>This is meant to be the one-stop-shop blog post for creating a very simple web service in PHP that pulls from a MySQL database and displaying the data in Silverlight. Emphasis on the “simple”. This tutorial is geared toward someone who has never done databases or web services.</p>
<p>Here is an example of the finished product (I reserve the right to clean up the data on a regular basis):</p>
<div id="silverlightControlHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500px" height="300px"><param name="source" value="http://designersilverlight.com/Silverlight/ToDo_List_Tutorial.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=3.0.40818.0" style="text-decoration: none;"><br />
				<img src="http://go.microsoft.com/fwlink/?LinkID=161376" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
			</a><br />
		</object><iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
<p>This tutorial will walk through the steps to create a simple to-do list. Our to-do list will hold text of what it is we need to do and a value indicating if the task has been done. In this tutorial, we will create a MySQL table to hold our data, a PHP service to call the data and a Silverlight application to display and interact with the data.</p>
<p><a href="http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-2/">Part 2: PHP</a></p>
<p><a href="http://www.designersilverlight.com/2010/05/24/php-mysql-and-silverlight-the-complete-tutorial-part-3/">Part 3: Silverlight</a></p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/AllFiles_PHP_and_Silverlight.zip">Download all files (PHP &#038; Silverlight)</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/PHP_Tutorial_Files.zip">Download PHP files only</a><br />
<a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/ToDo_List_Tutorial.zip">Download Silverlight project only</a></p>
<h2>Part 1: The MySQL Database</h2>
<p>First, let’s create the table we need for our data.</p>
<p>If you don’t have or don’t like phpMyAdmin, the MySQL query to create the table described below is:</p>
<p>CREATE TABLE `[your_database_name]`.`to_do_data` (<br />
`index_key` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,<br />
`is_done` TINYINT( 4 ) NOT NULL DEFAULT &#8217;0&#8242;,<br />
`to_do_text` TEXT NOT NULL ,<br />
FULLTEXT ( `to_do_text` )<br />
) ENGINE = MYISAM</p>
<p>If you have phpMyAdmin, I highly suggest using it if you’re a MySQL novice. In phpMyAdmin, go to your database and enter the name of the table you want to create in the “Create new table on database [your_db_name]” section.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0015.png"><img style="display: inline; border: 0px;" title="clip_image001[5]" src="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0015_thumb.png" border="0" alt="clip_image001[5]" width="445" height="105" /></a></p>
<p>We’ll call our table “to_do_data” and give it 3 fields.</p>
<ul>
<li>index_key – identifies the to-do item uniquely</li>
<li>is_done  &#8211; true/false value indicates the status of the to-do item</li>
<li>to_do_text &#8211; a short text to describe what needs to be done</li>
</ul>
<p>In phpMyAdmin, it will look like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0011.png"><img style="display: inline; border: 0px;" title="clip_image001" src="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image001_thumb1.png" border="0" alt="clip_image001" width="735" height="343" /></a></p>
<p>A couple of notes about the fields:</p>
<p><strong>index_key</strong></p>
<p>This is the primary key of the table and is used to uniquely identify the given row. As such, it cannot be null and it auto-increments as rows are added to the table.</p>
<p><strong>is_done</strong></p>
<p>We use “TINYINT” type for this value because <a href="http://stackoverflow.com/questions/289727/which-mysql-datatype-to-use-for-storing-boolean-values-from-to-php">using BOOLEAN is basically the same thing</a>. It is not null because every item must either be “done” or “not done”. “Done” = true = 1 and “not done” = false = 0. We are going to default to “0” (false) because we’re assuming that users aren’t going to make a to do list of stuff that is already complete.</p>
<p><strong>to_do_text</strong></p>
<p>We have artificially limited the text size to 1024 because we assume that this will be a set of short to-dos to, not a set of journal entries. We’ve also turned on “Fulltext” which lets the MySQL database index our entries for quick searching.</p>
<p>Now we just click the “Save” button at the bottom and we have our table.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0017.png"><img style="display: inline; border: 0px;" title="clip_image001[7]" src="http://www.designersilverlight.com/wp-content/uploads/2010/05/clip_image0017_thumb.png" border="0" alt="clip_image001[7]" width="794" height="105" /></a></p>
<p>Now our database system is in place and we’re ready to write a PHP webservice to implement all the CRUD (create, read, update, delete) capabilities our system will need.</p>
<p>If you want to learn more about MySQL, I highly recommend &#8220;<a href="http://www.amazon.com/gp/product/0471412767?ie=UTF8&#038;tag=irrationalopt-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0471412767">A Visual Introduction to SQL</a><img src="http://www.assoc-amazon.com/e/ir?t=irrationalopt-20&#038;l=as2&#038;o=1&#038;a=0471412767" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />&#8220;. This is the book I have, a left-over of my grad school years and it is an exceptional book for picking your way through various database scenarios. </p>
<p>If you&#8217;re looking for something a bit less costly, &#8220;<a href="http://www.amazon.com/gp/product/0672327120?ie=UTF8&#038;tag=irrationalopt-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0672327120">MySQL Crash Course</a><img src="http://www.assoc-amazon.com/e/ir?t=irrationalopt-20&#038;l=as2&#038;o=1&#038;a=0672327120" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />&#8221; is a fine book on the subject as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/05/23/php-mysql-and-silverlight-the-complete-tutorial-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
