<?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"
	>

<channel>
	<title>scorbs</title>
	<atom:link href="http://scorbs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scorbs.com</link>
	<description></description>
	<pubDate>Wed, 23 Jul 2008 20:31:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>FlickrViewr Using DevDave&#8217;s AnimatingWrapPanel</title>
		<link>http://scorbs.com/2008/07/17/flickrviewr-using-devdaves-animatingwrappanel/</link>
		<comments>http://scorbs.com/2008/07/17/flickrviewr-using-devdaves-animatingwrappanel/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 18:55:11 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[work]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/07/17/flickrviewr-using-devdaves-animatingwrappanel/</guid>
		<description><![CDATA[DevDave (Dave Relyea) is a dev lead on the Silverlight team.&#160; He just blogged a really slick new animating wrap panel.&#160; Read about it here and try out the sample app below.
&#160;
There are a bunch of different &#8220;interpolations&#8221; that you can choose from, including &#8220;back&#8221;, &#8220;elastic&#8221;, and &#8220;bounce.&#8221; 
I&#8217;ve updated my FlickrViewr to use this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.msdn.com/devdave">DevDave</a> (Dave Relyea) is a dev lead on the Silverlight team.&nbsp; He just blogged a really slick new animating wrap panel.&nbsp; Read about it <a href="http://scorbs.com/silverlight/wrappanel/" target="_blank">here</a> and try out the <a href="http://scorbs.com/silverlight/wrappanel/" target="_blank">sample app</a> below.</p>
<p>&nbsp;<a href="http://scorbs.com/silverlight/wrappanel/" target="_blank"><img src="http://blogs.msdn.com/photos/devdave/images/8742079/500x316.aspx"></a></p>
<p>There are a bunch of different &#8220;interpolations&#8221; that you can choose from, including &#8220;back&#8221;, &#8220;elastic&#8221;, and &#8220;bounce.&#8221; </p>
<p>I&#8217;ve updated my <a href="http://scorbs.com/2008/03/14/flickrviewr/" target="_blank">FlickrViewr</a> to use this animating wrap panel with the &#8220;elastic&#8221; option.&nbsp; In my totally unbiased opinion, it looks pretty hot.&nbsp; Though, as Dave pointed out, &#8220;elastic&#8221; is a bit much for a &#8220;real world&#8221; application - for a more sane UI, try &#8220;back&#8221; interpolation.</p>
<p>&nbsp;</p>
<p><a href="http://scorbs.com/silverlight/flickr/flickrviewr/"><img height="213" src="http://farm3.static.flickr.com/2202/2332719642_ed297d7e4f.jpg?v=0" width="240"></a> </p>
<p>(See the <a href="http://scorbs.com/2008/03/14/flickrviewr/">original post</a> for more info &amp; source code.) </p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/07/17/flickrviewr-using-devdaves-animatingwrappanel/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Design-Your-Own Plastic</title>
		<link>http://scorbs.com/2008/07/12/design-your-own-plastic/</link>
		<comments>http://scorbs.com/2008/07/12/design-your-own-plastic/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 22:55:22 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[life]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/07/12/design-your-own-plastic/</guid>
		<description><![CDATA[&#8230; credit card, that is.
Just noticed that flickr has partnered with CapitolOne.&#160; You can now put your own photos from flickr on your credit card.&#160; 
It&#8217;s a pretty genius idea - one of the reasons I like my current credit card is that it has a picture of Stanford on it.&#160; And whenever I use [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; credit card, that is.</p>
<p>Just noticed that <a href="http://flickr.com">flickr</a> has <a href="https://www.capitaloneimagecard.com/allaboutme/designer/capitaloneus/uscard/start.aspx">partnered</a> with <a href="http://www.capitalone.com/">CapitolOne</a>.&nbsp; You can now put your own photos from flickr on your credit card.&nbsp; </p>
<p>It&#8217;s a pretty genius idea - one of the reasons I like my current credit card is that it has a picture of Stanford on it.&nbsp; And whenever I use it, it reminds me of my college days, friends I made there, experiences I had, etc.&nbsp; The warm fuzzy usually only lasts about 2 seconds, but I like it enough that it&#8217;s a disincentive to change credit card companies.</p>
<p>Anyways, smart marketing move.&nbsp; Nice one, Flickr &amp; Capitol One!</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/07/untitled2.jpg"><img height="338" alt="Untitled" src="http://scorbs.com/wp-content/uploads/2008/07/untitled-thumb2.jpg" width="556"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/07/12/design-your-own-plastic/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FlickrViewr Updated for Beta2</title>
		<link>http://scorbs.com/2008/07/10/flickrviewr-updated-for-beta2/</link>
		<comments>http://scorbs.com/2008/07/10/flickrviewr-updated-for-beta2/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 01:03:26 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[work]]></category>

		<category><![CDATA[controlmodel]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[silverlight]]></category>

		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/07/10/flickrviewr-updated-for-beta2/</guid>
		<description><![CDATA[Just a note to say I&#8217;ve updated my FlickrViewr for Silverlight Beta2.&#160; (All of the controls now use VisualStateManager, too!)
Enjoy!

(See the original post for more info &#38; source code.)
]]></description>
			<content:encoded><![CDATA[<p>Just a note to say I&#8217;ve updated my <a href="http://scorbs.com/2008/03/14/flickrviewr/">FlickrViewr</a> for Silverlight Beta2.&nbsp; (All of the controls now use <a href="http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/">VisualStateManager</a>, too!)</p>
<p>Enjoy!</p>
<p><a href="http://scorbs.com/silverlight/flickr/flickrviewr/"><img height="213" src="http://farm3.static.flickr.com/2202/2332719642_ed297d7e4f.jpg?v=0" width="240"></a></p>
<p>(See the <a href="http://scorbs.com/2008/03/14/flickrviewr/">original post</a> for more info &amp; source code.)</p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/07/10/flickrviewr-updated-for-beta2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cave Art</title>
		<link>http://scorbs.com/2008/07/10/cave-art/</link>
		<comments>http://scorbs.com/2008/07/10/cave-art/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 16:48:28 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/07/10/cave-art/</guid>
		<description><![CDATA[I just read a fascinating article in the New Yorker: &#8220;First Impressions: What does the world’s oldest art say about us?&#8221; by Judith Thurman.
&#160; 
Here&#8217;s an excerpt from the first paragraph:
&#8230;After a visit to Lascaux [a cave in the South of France] &#8230;, which was discovered in 1940, Picasso reportedly said to his guide, “They’ve [...]]]></description>
			<content:encoded><![CDATA[<p>I just read a fascinating article in the New Yorker: <a href="http://www.newyorker.com/reporting/2008/06/23/080623fa_fact_thurman">&#8220;First Impressions: What does the world’s oldest art say about us?&#8221;</a> by Judith Thurman.</p>
<p>&nbsp;<img src="http://www.newyorker.com/images/2008/06/23/p465/080623_r17477_p465.jpg"> </p>
<p>Here&#8217;s an excerpt from the first paragraph:</p>
<blockquote><p><strong>&#8230;After a visit to Lascaux [a cave in the South of France] &#8230;, which was discovered in 1940, Picasso reportedly said to his guide, “They’ve invented everything.” </strong>What those first artists invented was a language of signs for which there will never be a Rosetta stone; <strong>perspective</strong>, a technique that was not rediscovered until the Athenian Golden Age; and a bestiary of such vitality and finesse that, by the flicker of torchlight, the animals seem to surge from the walls, and move across them like figures in a magic lantern show (in that sense, the artists invented <strong>animation</strong>). They also thought up &#8230; scaffolds to reach high places; the principles of <strong>stencilling</strong> and <strong>Pointillism</strong>; powdered colors, <strong>brushes</strong>, and stumping cloths; and, <strong>more to the point of Picasso’s insight, the very concept of an image</strong>. A true artist reimagines that concept with every blank canvas—but not from a void.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/07/10/cave-art/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Back From Spain</title>
		<link>http://scorbs.com/2008/07/09/back-from-spain/</link>
		<comments>http://scorbs.com/2008/07/09/back-from-spain/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 01:14:06 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[life]]></category>

		<category><![CDATA[spain]]></category>

		<category><![CDATA[europe]]></category>

		<category><![CDATA[photo]]></category>

		<category><![CDATA[photography]]></category>

		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://scorbs.com/?p=358</guid>
		<description><![CDATA[And I&#8217;m back.&#160; And totally jetlagged.
Spain was great - a fabulous country.&#160; I will definitely go back again.
Also, it turns out that &#34;vacation&#34; vacations do have some nice perks over &#34;adventure&#34; vacations:

Being able to brush your teeth without worrying about getting sick. 
Being able to eat fruit from street vendors without worrying about getting sick. [...]]]></description>
			<content:encoded><![CDATA[<p>And I&#8217;m back.&#160; And totally jetlagged.</p>
<p>Spain was great - a fabulous country.&#160; I will definitely go back again.</p>
<p>Also, it turns out that &quot;vacation&quot; vacations do have some nice perks over &quot;adventure&quot; vacations:</p>
<ol>
<li>Being able to brush your teeth without worrying about getting sick. </li>
<li>Being able to eat fruit from street vendors without worrying about getting sick. </li>
<li>Knowing that you&#8217;re not totally screwed if you lose your passport. </li>
<li>Not stressing about safety when calling a cab. </li>
<li>Western toilets. </li>
</ol>
<p>Oh, and amazing wine and cheese.&#160; Though, the exchange rate is rather killer.</p>
<p>Next trip?&#160; I&#8217;m thinking back to south america - but who knows.&#160; <img src='http://scorbs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#160;</p>
<p>Pictures coming soon. </p>
<p>&#160;</p>
<p><a title="Karen at the Guggenheim by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2653660635/"><img height="332" alt="Karen at the Guggenheim" src="http://farm4.static.flickr.com/3010/2653660635_734b235341.jpg" width="500" /></a></p>
<p><em>Me, in front of the <a href="http://en.wikipedia.org/wiki/Guggenheim_Museum_Bilbao">Guggenheim</a> in <a href="http://en.wikipedia.org/wiki/Bilbao">Bilbao, Spain</a>.&#160; </em><em>Taken an hour before sunset with the help of a park bench.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/07/09/back-from-spain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>La Sagrada Familia</title>
		<link>http://scorbs.com/2008/06/30/la-sagrada-familia/</link>
		<comments>http://scorbs.com/2008/06/30/la-sagrada-familia/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 20:10:28 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[life]]></category>

		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/30/la-sagrada-familia/</guid>
		<description><![CDATA[
La Sagrada Familia is Gaudi&#8217;s &#8220;masterpiece.&#8221;&#160; Construction on the temple began in 1882, and has been ongoing ever since.&#160; Gaudi died in 1926, and so several different architects have been tapped to flesh out the master&#8217;s design.
It was especially interesting seeing the interior of the temple, which had progressed significantly since I was there 4 [...]]]></description>
			<content:encoded><![CDATA[</p>
<p><a href="http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia">La Sagrada Familia</a> is <a href="http://en.wikipedia.org/wiki/Antoni_Gaud%C3%AD">Gaudi</a>&#8217;s &#8220;masterpiece.&#8221;&nbsp; Construction on the temple began in 1882, and has been ongoing ever since.&nbsp; Gaudi died in 1926, and so several different architects have been tapped to flesh out the master&#8217;s design.</p>
<p>It was especially interesting seeing the interior of the temple, which had progressed significantly since I was there 4 years ago.</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695942923/"><img height="332" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3157/2695942923_9ce340b65b.jpg" width="500"></a></p>
<p><em>the famous shape of the la sagrada familia</em>&nbsp;</p>
<p>&nbsp;</p>
</p>
<p>&nbsp;<a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695964987/"><img height="500" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3030/2695964987_f3b2a35c01.jpg" width="332"></a> </p>
<p><em>the soldiers were modeled after the shapes on the la pedrera&#8217;s roof</em></p>
<p>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695722235/"><img height="332" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3016/2695722235_ba47f6b8f4.jpg" width="500"></a> </p>
<p><em>parts of the passion facade</em></p>
<p><em></em>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695732391/"><img height="500" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3071/2695732391_8569f86468.jpg" width="332"></a></p>
<p><em>sculpture of jesus</em></p>
<p><em></em>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2696700100/"><img height="332" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3131/2696700100_5223911a00.jpg" width="500"></a></p>
<p><em>ceiling of the temple</em>&nbsp;</p>
<p>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2696696684/"><img height="332" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3289/2696696684_7591c97038.jpg" width="500"></a> </p>
<p><em>an unfinished stairwell</em></p>
<p>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695870809/"><img height="332" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3135/2695870809_1c2430772e.jpg" width="500"></a>&nbsp;</p>
<p><em>active construction</em></p>
<p>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2696744312/"><img height="500" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3220/2696744312_caa28c09a7.jpg" width="332"></a> </p>
<p><em>from the top</em></p>
<p><em></em>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695918805/"><img height="500" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3142/2695918805_22ca725d86.jpg" width="332"></a> </p>
<p><em>arches</em></p>
<p>&nbsp;</p>
<p><a title="La Sagrada Familia by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2695913531/"><img height="500" alt="La Sagrada Familia" src="http://farm4.static.flickr.com/3126/2695913531_e6e545d464.jpg" width="332"></a></p>
<p><em>rockin&#8217; out with mister turtle</em></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/30/la-sagrada-familia/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Random Barcelona</title>
		<link>http://scorbs.com/2008/06/29/random-barcelona/</link>
		<comments>http://scorbs.com/2008/06/29/random-barcelona/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 07:16:10 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<category><![CDATA[barcelona]]></category>

		<category><![CDATA[photography]]></category>

		<category><![CDATA[photos]]></category>

		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/05/29/random-barcelona/</guid>
		<description><![CDATA[A few random street shots&#8230;
&#160;

while walking through the Barri Gotti (Gothic Quarter), we came upon this wedding reception.
&#160;

these for-rent red bicycles were everywhere
&#160;

the building fronts were so, well, european (for lack of a better word)&#160;
&#160;
&#160;
a clothes rack in the apartments across from us
&#160;
 
peering down from the apartment
&#160;

bicycles in high places
]]></description>
			<content:encoded><![CDATA[<p>A few random street shots&#8230;</p>
<p>&nbsp;</p>
<p><a title="Barcelona Wedding by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2654144783/"><img height="332" alt="Barcelona Wedding" src="http://farm4.static.flickr.com/3068/2654144783_2b8933d7a9.jpg" width="500"></a></p>
<p><em>while walking through the </em><a href="http://en.wikipedia.org/wiki/Barri_G%C3%B2tic"><em>Barri Gotti</em></a><em> (Gothic Quarter), we came upon this wedding reception.</em></p>
<p>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2654483337/"><img height="357" alt="" src="http://farm4.static.flickr.com/3238/2654483337_53aa9da9a2.jpg" width="500"></a></p>
<p><em>these for-rent red bicycles were everywhere</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2655319646/"><img height="332" alt="" src="http://farm4.static.flickr.com/3204/2655319646_e2b52980f3.jpg" width="500"></a></p>
<p><em>the building fronts were so, well, european (for lack of a better word)</em>&nbsp;</p>
<p>&nbsp;</p>
<p><a title="Not Laundry Day by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2654964008/"><img height="332" alt="Not Laundry Day" src="http://farm4.static.flickr.com/3191/2654964008_2644e96571.jpg" width="500"></a>&nbsp;</p>
<p><em>a clothes rack in the apartments across from us</em></p>
<p><em></em>&nbsp;</p>
<p><img height="500" alt="Our Street" src="http://farm4.static.flickr.com/3024/2654138213_e8788289b8.jpg" width="332"> </p>
<p><em>peering down from the apartment</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2654134533/"><img height="332" alt="" src="http://farm4.static.flickr.com/3264/2654134533_10ec0e1cf6.jpg" width="500"></a></p>
<p><em>bicycles in high places</em></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/29/random-barcelona/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spain Wins Euro Cup 2008!</title>
		<link>http://scorbs.com/2008/06/29/spain-wins-euro-cup-2008/</link>
		<comments>http://scorbs.com/2008/06/29/spain-wins-euro-cup-2008/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 05:21:05 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/29/spain-wins-euro-cup-2008/</guid>
		<description><![CDATA[It was the first time that Spain won the Euro Cup 2008 in 22 years.&#160; (And the first time in about the same number of years that I watched a soccer match.)
The game was in Austria, so the viewing location was a bar in the Barri Gotti.
The celebration in the street afterwards was particularly memorable&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>It was the first time that Spain won the <a href="http://en.wikipedia.org/wiki/2008_UEFA_European_Football_Championship">Euro Cup 2008</a> in 22 years.&nbsp; (And the first time in about the same number of years that I watched a soccer match.)</p>
<p>The game was in Austria, so the viewing location was a bar in the <a href="http://en.wikipedia.org/wiki/Barri_G%C3%B2tic">Barri Gotti</a>.</p>
<p>The celebration in the street afterwards was particularly memorable&#8230; and also where I learned the life skill of operating an SLR with one hand, while have a beer in the other.</p>
<p>&nbsp; </p>
<p><a title="Euro Cup: Spain vs Germany by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2671832684/"><img height="332" alt="Euro Cup: Spain vs Germany" src="http://farm4.static.flickr.com/3224/2671832684_3c2c0342a8.jpg" width="500"></a>&nbsp;</p>
<p><em>folks were lined up on the street to see in&#8230;</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Euro Cup: Spain vs Germany by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2671842402/"><img height="332" alt="Euro Cup: Spain vs Germany" src="http://farm4.static.flickr.com/3184/2671842402_1d3fb23026.jpg" width="500"></a>&nbsp;</p>
<p><em>&#8230;and the celebration starts</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Cheers! by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2672725938/"><img height="332" alt="Cheers!" src="http://farm4.static.flickr.com/3080/2672725938_a3cfe61485.jpg" width="500"></a>&nbsp;</p>
<p><em>friendly folks sold beer on the streets for 1 euro</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Spain Wins Euro Cup! by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2672721072/"><img height="332" alt="Spain Wins Euro Cup!" src="http://farm4.static.flickr.com/3120/2672721072_49bf15e6bf.jpg" width="500"></a>&nbsp;</p>
<p><em>the spanish flag in motion:&nbsp; my first attempt at panning</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Euro Cup Celebration by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2672253214/"><img height="332" alt="Euro Cup Celebration" src="http://farm4.static.flickr.com/3155/2672253214_2d47ef3742.jpg" width="500"></a>&nbsp;</p>
<p>pouring on to <a href="http://en.wikipedia.org/wiki/La_Rambla,_Barcelona">las ramblas</a></p>
<p><a title="Spain Wins Euro Cup! by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2672732920/"><img height="332" alt="Spain Wins Euro Cup!" src="http://farm4.static.flickr.com/3194/2672732920_f7b05ce217.jpg" width="500"></a>&nbsp;</p>
<p><em>there was no &#8220;music&#8221;, so noise makers and chants filled the streets</em></p>
<p>&nbsp;</p>
<p><a title="Euro Cup Celebration by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2672257412/"><img height="332" alt="Euro Cup Celebration" src="http://farm3.static.flickr.com/2350/2672257412_0f03d180b5.jpg" width="500"></a>&nbsp; </p>
<p><em>and there were many many people out</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Spain Wins Euro Cup! by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2671891359/"><img height="332" alt="Spain Wins Euro Cup!" src="http://farm4.static.flickr.com/3192/2671891359_3f4d7622c2.jpg" width="500"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/29/spain-wins-euro-cup-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Casa Batllo</title>
		<link>http://scorbs.com/2008/06/29/casa-batllo/</link>
		<comments>http://scorbs.com/2008/06/29/casa-batllo/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 05:14:19 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/07/15/casa-batllo/</guid>
		<description><![CDATA[Unfortunately, I was only able to see Casa Batllo from the outside this trip (it was closed when I tried to go).&#160; It&#8217;s one of my Gaudi favorites.
&#160;

]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, I was only able to see <a href="http://en.wikipedia.org/wiki/Casa_Batll%C3%B3">Casa Batllo</a> from the outside this trip (it was closed when I tried to go).&nbsp; It&#8217;s one of my Gaudi favorites.</p>
<p>&nbsp;</p>
<p><a title="Casa Batllo by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2670062181/"><img height="332" alt="Casa Batllo" src="http://farm4.static.flickr.com/3047/2670062181_7183af02ab.jpg" width="500"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/29/casa-batllo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Breathing Fire</title>
		<link>http://scorbs.com/2008/06/29/breathing-fire/</link>
		<comments>http://scorbs.com/2008/06/29/breathing-fire/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 23:23:28 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/29/breathing-fire/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2671813672/"><img height="332" alt="" src="http://farm4.static.flickr.com/3226/2671813672_e655a6c879.jpg" width="500"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/29/breathing-fire/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Fabulous Barcelona Day</title>
		<link>http://scorbs.com/2008/06/29/a-fabulous-barcelona-day/</link>
		<comments>http://scorbs.com/2008/06/29/a-fabulous-barcelona-day/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 14:04:55 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<category><![CDATA[barcelona]]></category>

		<category><![CDATA[europe]]></category>

		<category><![CDATA[life]]></category>

		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/29/a-fabulous-barcelona-day/</guid>
		<description><![CDATA[Yesterday was my first full day in Barcelona.  It was a fabulous.
My friend Chris and I started at Museu Picasso.  My favorite part of this museum is Picasso&#8217;s Las Meninas study&#8230; (He did several interpretations of Vellasquez&#8217;s Las Meninas, which I saw in Madrid a few years ago.)  The current temporary exhibit [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday was my first full day in Barcelona.  It was a fabulous.</p>
<p>My friend Chris and I started at <strong><a href="http://www.museupicasso.bcn.cat/en/">Museu Picasso</a></strong>.  My favorite part of this museum is Picasso&#8217;s Las Meninas study&#8230; (He did several interpretations of Vellasquez&#8217;s Las Meninas, which I saw in Madrid a few years ago.)  The current <a href="http://www.museupicasso.bcn.cat/meninas/index_en.htm">temporary exhibit</a> displays the work of several other artists who have done Las Meninas interpretations.  It was great.</p>
<p>Next, we headed to <strong><a href="http://en.wikipedia.org/wiki/Antoni_Gaud%C3%AD">Gaudi</a>&#8217;s <a href="http://en.wikipedia.org/wiki/Park_Guell">Parque Guell</a></strong>, took pictures and had lots of <strong>sangria</strong>.</p>
<p>At night (and this was the coolest part), we went to Gaudi&#8217;s <strong><a href="http://en.wikipedia.org/wiki/La_Pedrera">La Pedrera</a> for a rooftop jazz concert</strong>. and free cava.  The band was awesome, and the ambience - set among Gaudi&#8217;s <a href="http://flickr.com/search/?q=lapedrera&#038;s=int">crazy knight-looking sculptures</a> - was perfect.</p>
<p>We ended with dinner Spanish-style (and jetlag-style) around 11:30pm, which included some great <a href="http://en.wikipedia.org/wiki/Cabrales_cheese"><strong>cabrales blue cheese</strong></a> and a <strong><a href="http://en.wikipedia.org/wiki/Denominaci%C3%B3n_de_Origen">DOQ</a> spanish red wine</strong>.</p>
<p>I think I could live in Barcelona.  <img src='http://scorbs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/29/a-fabulous-barcelona-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>La Pedrera de Nit</title>
		<link>http://scorbs.com/2008/06/28/jazz/</link>
		<comments>http://scorbs.com/2008/06/28/jazz/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 03:53:22 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<category><![CDATA[barcelona]]></category>

		<category><![CDATA[photography]]></category>

		<category><![CDATA[photos]]></category>

		<category><![CDATA[travel]]></category>

		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/28/jazz/</guid>
		<description><![CDATA[&#160;
On the plane to Spain, I read that there are sometimes nighttime concerts at La Pedrera, one of my favorite places from my previous Barcelona trip.
After asking around, we got tickets for &#8220;Noches de verano en La Pedrera.&#8221; The musician that night was Marc Ayza - he &#38; his band were fabulous.
All &#38; all, it [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<a href="http://scorbs.com/wp-content/uploads/2008/07/lapedrera.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="191" alt="lapedrera" src="http://scorbs.com/wp-content/uploads/2008/07/lapedrera-thumb.jpg" width="162" border="0"></a></p>
<p>On the plane to Spain, I read that there are sometimes nighttime concerts at La Pedrera, one of my favorite places from my previous Barcelona trip.</p>
<p>After asking around, we got tickets for &#8220;<a href="http://obrasocial.caixacatalunya.es/osocial/redirect.html?link=http://obrasocial.caixacatalunya.es/CDA/ObraSocial/OS_Plantilla2/0,3418,2x1y3233,00.html">Noches de verano en La Pedrera</a>.&#8221; The musician that night was <a href="http://www.myspaceprofiles.org/profiles/186834882.html">Marc Ayza</a> - he &amp; his band were fabulous.</p>
<p>All &amp; all, it was just a wonderful experience:&nbsp; great music &amp; good cava in the surreal surroundings of <a href="http://en.wikipedia.org/wiki/Antoni_Gaud%C3%AD">Gaudi</a>&#8217;s <a href="http://en.wikipedia.org/wiki/Casa_Mil%C3%A0">La Pedrera</a> rooftop. </p>
<p>&nbsp;</p>
<p><a title="La Pedrera by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2660331448/"><img height="332" alt="La Pedrera" src="http://farm4.static.flickr.com/3031/2660331448_c04a447ccd.jpg" width="500"></a></p>
<p>&nbsp;</p>
<p><a title="La Pedrera by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2660345198/"><img height="307" alt="La Pedrera" src="http://farm3.static.flickr.com/2244/2660345198_432eedee3e.jpg" width="500"></a></p>
<p>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2659553553/"><img height="332" alt="" src="http://farm4.static.flickr.com/3293/2659553553_4739931906.jpg" width="500"></a>&nbsp;</p>
<p>&nbsp;</p>
<p><a title="La Pedrera by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2659539517/"><img height="332" alt="La Pedrera" src="http://farm4.static.flickr.com/3102/2659539517_829be1fe6c.jpg" width="500"></a> </p>
<p>&nbsp;</p>
<p><a title="La Pedrera by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2660349366/"><img height="332" alt="La Pedrera" src="http://farm4.static.flickr.com/3146/2660349366_043d2de139.jpg" width="500"></a></p>
<p>&nbsp;</p>
<p><a title="La Pedrera by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2660363218/"><img height="332" alt="La Pedrera" src="http://farm4.static.flickr.com/3123/2660363218_226e72bf02.jpg" width="500"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/28/jazz/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Park Guell</title>
		<link>http://scorbs.com/2008/06/28/park-guell/</link>
		<comments>http://scorbs.com/2008/06/28/park-guell/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 20:09:57 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<category><![CDATA[barcelona]]></category>

		<category><![CDATA[europe]]></category>

		<category><![CDATA[life]]></category>

		<category><![CDATA[travel]]></category>

		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/28/park-guell/</guid>
		<description><![CDATA[ark Guell is Gaudi&#8217;s outdoor barcelona park.&#160; It&#8217;s relaxing, picturesque&#8230; and a great place for a pitcher of sangria. 
&#160;

barcelona skyline from the top of the park.&#160; (see the large version.)
&#160;

the main part of the park
&#160;

dragon
&#160;

euro smiles
&#160;
&#160;
mosaic
&#160;

there goes the bride
&#160;

ready for my sangria!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Park_Guell">ark Guell</a> is <a href="http://en.wikipedia.org/wiki/Antoni_Gaud%C3%AD">Gaudi</a>&#8217;s outdoor barcelona park.&nbsp; It&#8217;s relaxing, picturesque&#8230; and a great place for a pitcher of sangria. </p>
<p>&nbsp;</p>
<p><a title="Barcelona Skyline by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2654510803/"><img height="65" alt="Barcelona Skyline" src="http://farm4.static.flickr.com/3118/2654510803_af8bf1d2eb.jpg" width="500"></a></p>
<p><em>barcelona skyline from the top of the park.&nbsp; (see the <a href="http://www.flickr.com/photos/scorbs/2654510803/sizes/l/">large version</a>.)</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2657246149/"><img height="332" alt="" src="http://farm4.static.flickr.com/3058/2657246149_8f847a1b99.jpg" width="500"></a></p>
<p><em>the main part of the park</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2657251699/"><img height="332" alt="" src="http://farm4.static.flickr.com/3170/2657251699_047edf4fe0.jpg" width="500"></a></p>
<p><em>dragon</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2657268715/"><img height="500" alt="" src="http://farm4.static.flickr.com/3171/2657268715_bf94f6d307.jpg" width="332"></a></p>
<p><em>euro smiles</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2657294543/"><img height="332" alt="" src="http://farm4.static.flickr.com/3017/2657294543_d121cdd6e3.jpg" width="500"></a>&nbsp;</p>
<p>mosaic</p>
<p>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2658165576/"><img height="332" alt="" src="http://farm4.static.flickr.com/3099/2658165576_1ea31a4a83.jpg" width="500"></a></p>
<p><em>there goes the bride</em></p>
<p><em></em>&nbsp;</p>
<p><a title="Untitled by scorbette37, on Flickr" href="http://www.flickr.com/photos/scorbs/2658181950/"><img height="332" alt="" src="http://farm4.static.flickr.com/3079/2658181950_5091b8faa8.jpg" width="500"></a></p>
<p><em>ready for my sangria!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/28/park-guell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parts &#38; States Model with VisualStateManager (Part 4 of 4)</title>
		<link>http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/</link>
		<comments>http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 23:42:23 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/</guid>
		<description><![CDATA[Here we are - the final post of our Parts &#38; States Model series for Silverlight 2 controls.&#160; Hope you&#8217;ve enjoyed the ride so far!
Today, we&#8217;ll go through some general recommendations on how to use the Parts &#38; States model.&#160; We&#8217;ll also take a look ahead:&#160; VisualStateManager on Windows Presentation Foundation and future releases of [...]]]></description>
			<content:encoded><![CDATA[<p>Here we are - the final post of our Parts &amp; States Model series for Silverlight 2 controls.&nbsp; Hope you&#8217;ve enjoyed the ride so far!</p>
<p>Today, we&#8217;ll go through some general recommendations on how to use the Parts &amp; States model.&nbsp; We&#8217;ll also take a look ahead:&nbsp; VisualStateManager on Windows Presentation Foundation and future releases of Silverlight.</p>
<p>&nbsp;</p>
<p>(Series Link:&nbsp; <a href="http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/">Part 1</a>, <a href="http://scorbs.com/2008/06/18/parts-states-model-with-visualstatemanager-part-2-of-4/">Part 2</a>, <a href="http://scorbs.com/2008/06/23/parts-states-model-with-visualstatemanager-part-3-of-4/">Part 3</a>, <a href="http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/">Part 4</a>)</p>
<p>&nbsp;</p>
<p><strong><u>Parts &amp; States Model Recommendations</u></strong></p>
<p><em><strong>1.&nbsp; Use the Parts &amp; States Model with Custom Controls and UserControls</strong></em></p>
<p>Like we mentioned in the first post, the Parts &amp; States Model is just a pattern.&nbsp; It is not required by the runtime, and it&#8217;s perfectly fine to build controls without the Parts &amp; States Model and VisualStateManager.</p>
<p>However, we do think this is a good model.&nbsp; And Blend will only be able to support skinning of custom controls using the Parts &amp; States Model.</p>
<p>And while this series concentrated on VSM with Custom Controls, remember you can use it with UserControls as well!</p>
<p><em><strong></strong></em></p>
<p><em><strong>2.&nbsp; Custom VSM xmlns</strong></em></p>
<p>This one is less of a recommendation and more of a heads up.</p>
<p>Because of a known Silverlight 2 Beta 2 bug, you need to use a custom xmlns for VisualStateManager and its related classes.</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> xmlns:vsm=“clr-namespace:System.Windows;assembly=System.Windows”</pre>
</div>
</div>
<div>&nbsp;</div>
<div><em><strong>3.&nbsp; Naming conventions</strong></em></div>
<p>For consistency across controls, we recommend the following naming convention.</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/naming.jpg"><img height="167" alt="naming" src="http://scorbs.com/wp-content/uploads/2008/06/naming-thumb.jpg" width="433"></a></p>
<p><em><strong></strong></em></p>
<p><em><strong>4.&nbsp; CommonStates and FocusStates are special</strong></em></p>
<p>Many controls define these two state groups:</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/specialstates.jpg"><img height="264" alt="specialstates" src="http://scorbs.com/wp-content/uploads/2008/06/specialstates-thumb.jpg" width="226"></a></p>
<p>If your control is going to have some or all of these states, for consistency, we recommend the above grouping and naming. </p>
<p><strong><em></em></strong></p>
<p><strong><em>5. Be resilient to missing Parts &amp; States in template</em> </strong></p>
<p>There are many reasons why a particular ControlTemplate might not supply a given part or state:&nbsp; the designer may have deliberately chosen to leave it out.&nbsp; He/she might not have created it yet.&nbsp; And so on.</p>
<p>It is good practice to prevent crashes or other catastrophic failures when a part is missing. </p>
<p>Note: The VisualStateManager.GoToState() method already takes care of this for states - it returns false when the target VisualState is not found.</p>
<p>&nbsp;</p>
<p><strong></strong></p>
<p><em><strong>6.&nbsp; Consider supporting “fallback” states</strong> </em></p>
<p>For complex controls, it is sometimes interesting to provide a fallback mechanism for particular states that do not exist.</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">if</span> (VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, “FocusContent”, useTransitions) == <span style="color: #0000ff">false</span>) </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>     VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, “Focus&#8221;, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> } </pre>
</div>
</div>
<p>The advantage of this approach are pretty intuitive:&nbsp; the control continues to visually function correctly when a designer hasn&#8217;t provided a particular state.</p>
<p>But there are also some significant negatives: the fallback states mechanism isn&#8217;t fully integrated into the Parts &amp; States model, which means that Blend has no way of knowing about them. </p>
<p>So, please use fallback states sparingly and only when the control is sufficiently complex enough to warrants it.</p>
<p>Also, if you think this is a pattern that you&#8217;ll leverage often, let us know!&nbsp; We&#8217;d love the feedback.</p>
<p><em><strong></strong></em></p>
<p><em><strong>7.&nbsp; Subclasses should only add states in new state groups (not existing state groups)</strong></em></p>
<p>As you know, each state group is orthogonal.&nbsp; This makes it easy for a subclass to add new state groups.&nbsp; For instance, you can create a StackButton that derives from Button and adds a StackStates group:</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/newstategroup.jpg"><img height="316" alt="newstategroup" src="http://scorbs.com/wp-content/uploads/2008/06/newstategroup-thumb.jpg" width="399"></a></p>
<p>This works because the StackStates state group logic is completely independent from the Button&#8217;s logic around CommonStates &amp; FocusStates.</p>
<p>However, if you want to add a new state to an <u>existing</u> state group, the state group logic can become jumbled.&nbsp; It&#8217;s is difficult to guarantee that the right logical state checks will happen in the right order.</p>
<p>Let&#8217;s make this clearer with an example.&nbsp; BasicControl defines two states in its CommonStates: Normal, MouseOver.&nbsp; Its logical state machine is:</p>
<ul>
<li><em>if (mouse is not over control) goto Normal</em>
<li><em>if (mouse is over control) goto MouseOver</em> </li>
</ul>
<p>Now, ExtendedControl derives from BasicControls and wants to add a Pressed state.&nbsp; The goal logical state machine would be:</p>
<ul>
<li><em>if (mouse is not over control) goto Normal</em>
<li><em>if (mouse is over control <u>AND mouse button is not down</u>) goto MouseOver</em>
<li><em>if (mouse button is down) goto Pressed</em> </li>
</ul>
<p>However, there is no good for way for ExtendedControl to add the (<em>AND mouse button is not down</em>) check for the MouseOver state, since that logic lives in the Button base class.</p>
<p>All this just means:&nbsp; Subclasses can always add new states to an new state group.&nbsp; But we recommend against adding new states to existing state groups.</p>
<p>Note:&nbsp; There are different ways (each with its own pluses &amp; minuses) for the platform to address this limitation in a future version.&nbsp; We&#8217;re currently leaning towards a Triggers-based solution (yes, I said triggers).&nbsp; For more, keep reading.</p>
<p>&nbsp;</p>
<p><strong><u>Looking Ahead</u></strong></p>
<p><strong><em>VSM &amp; Windows Presentation Foundation</em></strong></p>
<p>Silverlight&#8217;s Parts &amp; States Model leverages many features (like ControlTemplates, GetTemplateChild() helpers, etc) that already exist in Windows Presentation Foundation.</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/wpf.jpg"><img height="52" alt="wpf" src="http://scorbs.com/wp-content/uploads/2008/06/wpf-thumb.jpg" width="214"></a></p>
<p>However, there are some features - namely VisualStateManager and its associated classes - that do not yet exist in WPF.&nbsp;&nbsp; <u>The good news is that the next version of Windows Presentation Foundation will include VisualStateManager!</u></p>
<p>For some that are trying to move their Siverlight 2 controls &amp; skins to WPF now, the next version of the .NET framework may feel a ways off.&nbsp; To help remedy that, we are currently looking into shipping a WPF assembly that contains VisualStateManager before the next full release of WPF.&nbsp; Plans are still early - and so the timeline &amp; ship vehicle details are still being worked out. </p>
<p>More details as we have them!</p>
<p><strong><em></em></strong></p>
<p><strong><em><u>Future Silverlight Features</u></em></strong></p>
<p>One of the often asked questions about the Silverlight control model is:&nbsp; &#8220;Where are the Triggers?&#8221;&nbsp; In fact, it&#8217;s normally, &#8220;Where are the TRIGGERS?????&#8221;&nbsp; <img src='http://scorbs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are a lot of different reasons why we were not able to bring Triggers into the Silverlight 2 release.&nbsp; The primary technical challenge was that our property system architecture is not sufficiently complex to support them.&nbsp; This will however change in a future version of Silverlight, and then we&#8217;ll be able to start supporting Triggers.</p>
<p>How would Triggers &amp; VSM play together?&nbsp; The tentative design brainstorm looks something like:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">PropertyTrigger</span> <span style="color: #ff0000">Property</span><span style="color: #0000ff">=&#8221;IsPressed&#8221;</span> <span style="color: #ff0000">Value</span><span style="color: #0000ff">=&#8221;True&#8221;</span><span style="color: #0000ff">&gt;</span>  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">GoToState</span> <span style="color: #ff0000">State</span><span style="color: #0000ff">=&#8221;Pressed&#8221;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">PropertyTrigger</span><span style="color: #0000ff">&gt;</span></pre>
</div>
</div>
<p><strong></strong></p>
<p>The platform would provide a GoToState trigger action that causes VisualStateManager to initiate a state change to the desired state. </p>
<p>The designer would, then, have the option of using the built-in states that come with the control (and leaving the visual state change logic to the control).&nbsp; OR, he/she can take over and trigger all the VSM state changes from XAML.&nbsp; In the latter case, it would also be possible for the designer to add states to new or existing state groups that a control code does not know about.</p>
<p>Exciting stuff coming! </p>
<p>&nbsp;</p>
<p><strong><u>The End</u></strong></p>
<p>So that&#8217;s the end of our 4 part series on the Silverlight 2 Parts &amp; States Model.&nbsp; If you have questions or feedback, we&#8217;d love to hear it.</p>
<p>If this series has wet your appetite for VisualStateManager, here are some more great resources:</p>
<ul>
<li><a href="http://electricbeach.org/">Christian Schormann</a>&#8217;s Blog (Group Program Manager for Expression Blend)
<ul>
<li><a href="http://electricbeach.org/?p=98">Creating Control Skins with Visual State Manager - An Introduction</a>
<li><a href="http://electricbeach.org/?p=100">Visual State Manager: Goals</a>
<li><a href="http://electricbeach.org/?p=107">Visual State Manager for User Controls: A Simple Chord Finder Example</a> </li>
</ul>
<li>Steve White&#8217;s video tutorials (Program Manager for Expression Blend)
<ul>
<li><a href="http://expression.microsoft.com/en-us/cc643423.aspx ">Expression tutorials</a> </li>
</ul>
<li>Celso Gomes&#8217;s tutorials (Designer for Expression Blend)
<ul>
<li><a title="http://www.nibblestutorials.net/" href="http://www.nibblestutorials.net/">http://www.nibblestutorials.net/</a> </li>
</ul>
<li><a href="http://www.timheuer.com/blog">Tim Heuer</a>&#8217;s Blog (Senior Program Manager on the .NET Developer Platform)
<ul>
<li><a title="http://www.timheuer.com/blog/archive/2008/06/04/skinning-silverlight-controls-made-easier.aspx" href="http://www.timheuer.com/blog/archive/2008/06/04/skinning-silverlight-controls-made-easier.aspx">Skinning Silverlight controls just got easier</a>
<li><a title="http://www.timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx" href="http://www.timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx">Silverlight and the VisualStateManager</a> </li>
</ul>
<li><a href="http://silverlight.net/blogs/jesseliberty">Jesse Liberty</a>&#8217;s tutorials (Senior Program Manager on the .NET Developer Platform)</li>
<ul>
<li><a href="http://silverlight.net/learn/tutorials/StylesTemplatesVSM.aspx">Styles, Templates, and VisualStateManager</a></li>
</ul>
<li><a href="http://weblogs.asp.net/scottgu">Scott Guthrie</a>&#8217;s Blog (Corporate Vice President of the Developer Division)
<ul>
<li><a title="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx" href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx">Silverlight 2 Beta2 Released</a> </li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spain!</title>
		<link>http://scorbs.com/2008/06/23/spain/</link>
		<comments>http://scorbs.com/2008/06/23/spain/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 04:51:58 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[spain]]></category>

		<category><![CDATA[life]]></category>

		<category><![CDATA[travel]]></category>

		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/23/spain/</guid>
		<description><![CDATA[On Thursday, I leave for a week and a half vacation to Spain.&#160; This will be my first &#34;first world&#34; international vacation in a while&#8230;&#160; (Actually since I went to Barcelona &#38; Prague four and half years ago. )
I&#8217;m looking forward to simply relaxing and enjoying the beauty (and wine) of Spain.&#160; On the other [...]]]></description>
			<content:encoded><![CDATA[<p>On Thursday, I leave for a week and a half vacation to <a href="http://scorbs.com/2008/04/22/silverlight-http-networking-stack-part-3-configuring-a-cross-domain-policy-file/">Spain</a>.&#160; This will be my first &quot;first world&quot; international vacation in a while&#8230;&#160; (Actually since I went to <a href="http://en.wikipedia.org/wiki/Barcelona">Barcelona</a> &amp; <a href="http://en.wikipedia.org/wiki/Kbely">Prague</a> four and half years ago. )</p>
<p>I&#8217;m looking forward to simply relaxing and enjoying the beauty (and wine) of Spain.&#160; On the other hand, I&#8217;m so NOT looking forward to&#160; the dollar &lt;-&gt; euro exchange rate.</p>
<p>&#160; <a href="http://scorbs.com/wp-content/uploads/2008/06/spain.jpg"><img height="348" alt="spain" src="http://scorbs.com/wp-content/uploads/2008/06/spain-thumb.jpg" width="378" /></a> </p>
<p>The plan is split time between <a href="http://en.wikipedia.org/wiki/Barcelona">Barcelona</a> and <a href="http://en.wikipedia.org/wiki/San_Sebasti%C3%A1n">San Sebastian</a>, with a side trip to see the <a href="http://en.wikipedia.org/wiki/Guggenheim_Museum_Bilbao">Guggenheim</a> in <a href="http://en.wikipedia.org/wiki/Bilbao">Bilbao</a>.</p>
<p>I&#8217;m also making planning on taking a lot of pictures.&#160; :)&#160; </p>
<p>However, I&#8217;ve got a new resolution to take my time post-processing them when I get back.&#160; I usually just rush through it, and end up getting burnt out on.&#160; So, expect a long trickle of Spanish Photography!</p>
<p>Quick Facts:</p>
<ul>
<li>money:
<ul>
<li>1.00 euro = 1.552 usd (OUCH)</li>
</ul>
</li>
<li>local time:
<ul>
<li>UTC + 1 (noon in seattle =&gt; 11:23pm in spain) </li>
</ul>
</li>
<li>weather:&#160;
<ul>
<li>Barcelona = <a href="http://weather.msn.com/tenday.aspx?wealocations=wc:SPXX0015">87F &amp; Sunny</a> </li>
<li>Sunny, San Sebastian = <a href="http://weather.msn.com/tenday.aspx?wealocations=wc:SPXX0191">70F, Partly Cloudy</a> </li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scorbs.com/2008/06/23/spain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parts &#38; States Model with VisualStateManager (Part 3 of 4)</title>
		<link>http://scorbs.com/2008/06/23/parts-states-model-with-visualstatemanager-part-3-of-4/</link>
		<comments>http://scorbs.com/2008/06/23/parts-states-model-with-visualstatemanager-part-3-of-4/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 18:37:22 +0000</pubDate>
		<dc:creator>Karen</dc:creator>
		
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://scorbs.com/2008/06/23/parts-states-model-with-visualstatemanager-part-3-of-4/</guid>
		<description><![CDATA[This is the third post in a four part series on Silverlight 2&#8217;s Parts &#38; States control model.
Last time, you learned how to reskin an existing control using VisualStateManager.&#160; In this post, you&#8217;ll see how to build up a Parts &#38; States-based custom control.&#160; We&#8217;ll also explore how you can create more sophisticated visual transitions.
(Series [...]]]></description>
			<content:encoded><![CDATA[<p>This is the third post in a four part series on Silverlight 2&#8217;s Parts &amp; States control model.</p>
<p><a href="http://scorbs.com/2008/06/18/parts-states-model-with-visualstatemanager-part-2-of-4/">Last time</a>, you learned how to reskin an existing control using VisualStateManager.&nbsp; In this post, you&#8217;ll see how to build up a Parts &amp; States-based custom control.&nbsp; We&#8217;ll also explore how you can create more sophisticated visual transitions.</p>
<p>(Series Link:&nbsp; <a href="http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/">Part 1</a>, <a href="http://scorbs.com/2008/06/18/parts-states-model-with-visualstatemanager-part-2-of-4/">Part 2</a>, <a href="http://scorbs.com/2008/06/23/parts-states-model-with-visualstatemanager-part-3-of-4/">Part 3</a>, <a href="http://scorbs.com/2008/06/25/parts-states-model-with-visualstatemanager-part-4-of-4/">Part 4</a>)</p>
<p>&nbsp;</p>
<p><strong></strong></p>
<p><strong><u>VisualStateManager</u></strong></p>
<p>We&#8217;ve saw it briefly in the last post, but let&#8217;s formally introduce VisualStateManager.&nbsp; <img src='http://scorbs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/vsm.jpg"><img height="181" alt="VSM" src="http://scorbs.com/wp-content/uploads/2008/06/vsm-thumb.jpg" width="457"></a></p>
<p>VisualStateManager is the class responsible for control visual state management.&nbsp; The &#8220;visual&#8221; modifier in that sentence is important - the control code remains in charge of the logical state machine.</p>
<p>VSM exposes two main pieces of PME:</p>
<ul>
<li>a <strong>VisualStateGroups attached property</strong>
<ul>
<li>This property is set on the control template&#8217;s root visual and contains all the visual states &amp; transitions for that skin </li>
</ul>
<li>a <strong>static GoToState() method</strong>&nbsp;
<ul>
<li>This method causes VisualStateManager to transition the control&#8217;s visuals from one visual state to another. </li>
</ul>
</li>
</ul>
<p>Last time, we concentrated on the VisualStateGroups property in XAML.&nbsp; Today, we&#8217;ll dig into how the control code leverages that GoToState() method.</p>
<p>&nbsp;</p>
<p><strong></strong></p>
<p><strong><u>WeatherControl</u></strong></p>
<p>The custom control that we&#8217;ll be looking at today is a simple WeatherControl. The shell of the control code can be found below.&nbsp; (Note: For readability, I&#8217;ve collapsed some of the code snippets.&nbsp; You can find the <a href="http://scorbs.com/silverlight/weathercontrolpost/complextransitions/WeatherApp.zip">full sample code</a> here.)</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> WeatherControl : Control</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">public</span> WeatherControl()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>         DefaultStyleKey = <span style="color: #0000ff">typeof</span>(WeatherControl);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     <span style="color: #008000">// OnApplyTemplate()</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> OnApplyTemplate()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>         <span style="color: #0000ff">base</span>.OnApplyTemplate();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     <span style="color: #008000">// Temperature DP</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty TemperatureProperty = DependencyProperty.Register(<span style="color: #006080">&#8220;Temperature&#8221;</span>, <span style="color: #0000ff">typeof</span>(string), <span style="color: #0000ff">typeof</span>(WeatherControl),<span style="color: #0000ff">null</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Temperature</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>         get { &#8230; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>         set { &#8230; } </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     <span style="color: #008000">// Condition DP</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty ConditionProperty = DependencyProperty.Register(<span style="color: #006080">&#8220;Condition&#8221;</span>, <span style="color: #0000ff">typeof</span>(Condition), <span style="color: #0000ff">typeof</span>(WeatherControl), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">new</span> PropertyChangedCallback(WeatherControl.OnConditionPropertyChanged)));</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>     <span style="color: #0000ff">public</span> Condition Condition</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>         get { &#8230; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>         set { &#8230; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>     <span style="color: #008000">// ConditionDescription DP</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty ConditionDescriptionProperty = DependencyProperty.Register(<span style="color: #006080">&#8220;ConditionDescription&#8221;</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>), <span style="color: #0000ff">typeof</span>(WeatherControl), <span style="color: #0000ff">null</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> ConditionDescription</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>         get { &#8230; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>         set { &#8230; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>     <span style="color: #008000">// Property change notification</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span>     <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> OnConditionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  41:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  42:</span>         WeatherControl weather = d <span style="color: #0000ff">as</span> WeatherControl;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  43:</span>         &#8230;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  44:</span>         weather.OnWeatherChange(<span style="color: #0000ff">null</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  45:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  46:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  47:</span>     <span style="color: #008000">// OnWeatherChange virtual</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  48:</span>     <span style="color: #0000ff">protected</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">void</span> OnWeatherChange(RoutedEventArgs e)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  49:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  50:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  51:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  52:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<p>You can see that our WeatherControl&#8230;</p>
<ul>
<li>is a custom control, deriving from Control.
<li>defines its own built-in style, as indicated by the DefaultStyleKey.
<li>has 3 public dependency properties:&nbsp;
<ul>
<li>Temperature
<li>Condition
<li>ConditionDescription </li>
</ul>
</li>
</ul>
<p>In order to make our WeatherControl skinnable with VSM, we need to:</p>
<ul>
<li>define a control contract
<li>discover &amp; manipulate parts
<li>wire up appropriate state changes using VisualStateManager </li>
</ul>
<p>Here we go!</p>
<p><strong><u></u></strong></p>
<p><strong><u>Defining the Control Contract</u></strong></p>
<p>The control code is responsible for documenting the control contract.&nbsp; This means it should declare any and all expected Parts and States.&nbsp; Control contract declaration is done using class level metadata:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> [TemplatePart(Name=<span style="color: #006080">"Core"</span>, Type=<span style="color: #0000ff">typeof</span>(FrameworkElement))]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> [TemplateVisualState(Name=<span style="color: #006080">"Normal"</span>, GroupName=<span style="color: #006080">"CommonStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> [TemplateVisualState(Name=<span style="color: #006080">"MouseOver"</span>, GroupName=<span style="color: #006080">"CommonStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> [TemplateVisualState(Name=<span style="color: #006080">"Pressed"</span>, GroupName=<span style="color: #006080">"CommonStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> [TemplateVisualState(Name=<span style="color: #006080">"Sunny"</span>, GroupName=<span style="color: #006080">"WeatherStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span> [TemplateVisualState(Name=<span style="color: #006080">"PartlyCloudy"</span>, GroupName=<span style="color: #006080">"WeatherStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> [TemplateVisualState(Name=<span style="color: #006080">"Cloudy"</span>, GroupName=<span style="color: #006080">"WeatherStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span> [TemplateVisualState(Name=<span style="color: #006080">"Rainy"</span>, GroupName=<span style="color: #006080">"WeatherStates"</span>)]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> WeatherControl : Control</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     &#8230;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span> }</pre>
</div>
</div>
<p>In the above snippet, there are two attribute classes:</p>
<ul>
<li><strong>TemplatePartAttribute</strong>
<ul>
<li>Specifies the name of the part &amp; expected type </li>
</ul>
<li><strong>TemplateVisualStateAttribute</strong>
<ul>
<li>Specifies the name of the state &amp; its associated state group </li>
</ul>
</li>
</ul>
<p>This metadata is not used by the runtime.&nbsp; However, it is leveraged by tools like <a href="http://www.microsoft.com/expression/products/overview.aspx?key=blend">Expression Blend</a> for their skinning support, so it&#8217;s important to include.</p>
<p>These attributes on the WeatherControl give rise to the following control bill of materials:</p>
<p><a href="http://scorbs.com/wp-content/uploads/2008/06/contract.jpg"><img height="333" alt="contract" src="http://scorbs.com/wp-content/uploads/2008/06/contract-thumb.jpg" width="425"></a></p>
<p>Now, let&#8217;s see how the control code manipulates Parts.</p>
<p><strong></strong></p>
<p><strong><u>Discovering Parts</u></strong></p>
<p>Parts are named elements in the template and need to be manually discovered by the control code.&nbsp; This is done in the OnApplyTemplate() virtual, which is called whenever a new template is applied.</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #008000">// OnApplyTemplate</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> OnApplyTemplate()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">base</span>.OnApplyTemplate();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     CorePart = (FrameworkElement)GetTemplateChild(<span style="color: #006080">&#8220;Core&#8221;</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> <span style="color: #008000">// private CorePart property</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span> <span style="color: #0000ff">private</span> FrameworkElement CorePart</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>     get</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">return</span> corePart;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     set</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>         FrameworkElement oldCorePart = corePart;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>         <span style="color: #0000ff">if</span> (oldCorePart != <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>         {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>             oldCorePart.MouseEnter -= <span style="color: #0000ff">new</span> MouseEventHandler(corePart_MouseEnter);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>             oldCorePart.MouseLeave -= <span style="color: #0000ff">new</span> MouseEventHandler(corePart_MouseLeave);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>             oldCorePart.MouseLeftButtonDown -= <span style="color: #0000ff">new</span> MouseButtonEventHandler(corePart_MouseLeftButtonDown);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>             oldCorePart.MouseLeftButtonUp -= <span style="color: #0000ff">new</span> MouseButtonEventHandler(corePart_MouseLeftButtonUp);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>         }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>         corePart = <span style="color: #0000ff">value</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>         <span style="color: #0000ff">if</span> (corePart != <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>         {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>             corePart.MouseEnter += <span style="color: #0000ff">new</span> MouseEventHandler(corePart_MouseEnter);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>             corePart.MouseLeave += <span style="color: #0000ff">new</span> MouseEventHandler(corePart_MouseLeave);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>             corePart.MouseLeftButtonDown += <span style="color: #0000ff">new</span> MouseButtonEventHandler(corePart_MouseLeftButtonDown);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>             corePart.MouseLeftButtonUp += <span style="color: #0000ff">new</span> MouseButtonEventHandler(corePart_MouseLeftButtonUp);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>         }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span> }</pre>
</div>
</div>
<p>To find a named element inside of the template, you use the <strong>GetTemplateChild() </strong>helper method.</p>
<p>In the above example, we discover the &#8220;Core&#8221; part, which we will use to determine when the control should go into the MouseOver or Pressed states.&nbsp; Note that the setter logic is resilient to the Core part not being in the template.&nbsp; This is important, because a control needs to be robust enough to handle a part that is missing or not yet been added.</p>
<p>&nbsp;</p>
<p><strong><u>Initiating State Changes</u></strong></p>
<p>The control code is responsible for telling VisualStateManager when a visual state change should occur.&nbsp; Therefore, it must maintain the logical state machine that is associated with the visual state machine.</p>
<p>All of Silverlight 2&#8217;s built-in controls create a simple helper method to assist with the state changes.&nbsp; We recommend that you follow a similar pattern:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #008000">// GoToState() helper</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> GoToState(<span style="color: #0000ff">bool</span> useTransitions)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #008000">//  Go to states in NormalStates state group</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">if</span> (isPressed)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;Pressed&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (isMouseOver)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;MouseOver&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     <span style="color: #0000ff">else</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;Normal&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     <span style="color: #008000">//  Go to states in WeatherStates state group</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>     <span style="color: #0000ff">if</span> (Condition ==  Condition.PartlyCloudy)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;PartlyCloudy&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (Condition == Condition.Sunny)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;Sunny&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>     <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (Condition == Condition.Cloudy)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>         VisualStateManager.GoToState(<span style="color: #0000ff">this</span>, <span style="color: #006080">&#8220;Cloudy&#8221;</span>, useTransitions);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100