<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The FlexWinds blog</title>
	<atom:link href="http://flexwinds.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexwinds.wordpress.com</link>
	<description>Exploring the world of Flash, Flex, Apollo and beyond</description>
	<lastBuildDate>Wed, 18 Jan 2012 03:06:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='flexwinds.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The FlexWinds blog</title>
		<link>http://flexwinds.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://flexwinds.wordpress.com/osd.xml" title="The FlexWinds blog" />
	<atom:link rel='hub' href='http://flexwinds.wordpress.com/?pushpress=hub'/>
		<item>
		<title>My first Apollo App – Flickr Sets viewer</title>
		<link>http://flexwinds.wordpress.com/2007/03/27/my-first-apollo-app-%e2%80%93-flickr-sets-viewer/</link>
		<comments>http://flexwinds.wordpress.com/2007/03/27/my-first-apollo-app-%e2%80%93-flickr-sets-viewer/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 13:21:27 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[apollo]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cairngorm]]></category>
		<category><![CDATA[flickr]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/03/27/my-first-apollo-app-%e2%80%93-flickr-sets-viewer/</guid>
		<description><![CDATA[I was playing with the Apollo bits for last few days, trying out the different APIs. Finally decided to do something with Flickr…because it&#8217;s so damn easy The app I built is a simple viewer for your flickr sets. The app uses the standard Cairngorm approach to structuring the code. The DisplayShelf component for the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=48&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was playing with the Apollo bits for last few days, trying out the different APIs. Finally decided to do something with Flickr…because it&#8217;s so damn easy <span style="font-family:Wingdings;"> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span> The app I built is a simple viewer for your flickr sets.</p>
<p align="center"><img src="http://flexwinds.files.wordpress.com/2007/03/downloadr.png?w=780" alt="Downloadr screenshot" /></p>
<p>The app uses the standard <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> approach to structuring the code. The <a href="http://www.quietlyscheming.com/blog/components/tutorial-displayshelf-component/">DisplayShelf</a> component for the sets is from <a href="http://www.quietlyscheming.com/blog/">Quitely Scheming</a>. When you select a set, it lazy downloads all the pictures for that set. I haven&#8217;t written the code to download to a directory, but that can be added easily. As expected its all data-bound with the ModelLocator. I have a FlickrDelegate class that does the job of talking to Flickr using the <a href="http://code.google.com/p/as3flickrlib/">as3flickrlib</a>.</p>
<p><a href="http://www.podila.net/files/Downloadr.air">Download the AIR file</a></p>
<p><a href="http://www.podila.net/files/Downloadr.zip">Download the Source</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=48&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/03/27/my-first-apollo-app-%e2%80%93-flickr-sets-viewer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>

		<media:content url="http://flexwinds.files.wordpress.com/2007/03/downloadr.png" medium="image">
			<media:title type="html">Downloadr screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>ApolloCamp</title>
		<link>http://flexwinds.wordpress.com/2007/03/07/apollocamp/</link>
		<comments>http://flexwinds.wordpress.com/2007/03/07/apollocamp/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 17:18:03 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[apollo]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/03/07/apollocamp/</guid>
		<description><![CDATA[I will be there for the ApolloCamp on March 16th at the Adobe Headquarters in SFO, CA. If any of you guys are coming over, I would love to meet up. Technorati tags: apollo, adobe<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=46&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I will be there for the ApolloCamp on March 16th at the Adobe Headquarters in SFO, CA. If any of you guys are coming over, I would love to meet up.</p>
<p><img src="http://flexwinds.files.wordpress.com/2007/03/windowslivewriterapollocamp-acf5image08.png?w=640&#038;h=416" height="416" width="640" /></p>
<p class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/apollo" rel="tag">apollo</a>, <a href="http://technorati.com/tags/adobe" rel="tag">adobe</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=46&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/03/07/apollocamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>

		<media:content url="http://flexwinds.files.wordpress.com/2007/03/windowslivewriterapollocamp-acf5image08.png" medium="image" />
	</item>
		<item>
		<title>Flex and WPF: A comparison – Part 3a</title>
		<link>http://flexwinds.wordpress.com/2007/02/22/flex-and-wpf-a-comparison-%e2%80%93-part-3a/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/22/flex-and-wpf-a-comparison-%e2%80%93-part-3a/#comments</comments>
		<pubDate>Thu, 22 Feb 2007 21:08:40 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[comparison]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/22/flex-and-wpf-a-comparison-%e2%80%93-part-3a/</guid>
		<description><![CDATA[In this installment of the comparison posts I will look at the Animation framework in WPF and Flex. Both these technologies have vastly simplified the programming model for doing animations on your User Interface. Both of them allow animations to be created using markup (XAML/MXML) or code (C#/AS3). There are a number of animations that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=44&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this installment of the comparison posts I will look at the Animation framework in WPF and Flex. Both these technologies have vastly simplified the programming model for doing animations on your User Interface. Both of them allow animations to be created using markup (XAML/MXML) or code (C#/AS3). There are a number of animations that can be used out-of-the-box and you can also create your own custom animations.</p>
<p>Since this part is again pretty long, I am splitting it into 2 subparts. In this subpart I&#8217;ll cover the way it is done in WPF.</p>
<p><strong>In WPF…<br />
</strong></p>
<p>Animations in WPF are typically created using Storyboards. Storyboards are timeline-based animations that run for a specific period of time and target specific elements on the UI. Let&#8217;s look at the XAML for a simple Storyboard that fades an Ellipse from opaque to transparent in one second.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Grid</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Canvas</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Margin</span><span style="color:blue;">=&#8221;30&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Width</span><span style="color:blue;">=&#8221;230&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Height</span><span style="color:blue;">=&#8221;230&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Background</span><span style="color:blue;">=&#8221;Gray&#8221;&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Canvas.Resources</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Storyboard</span><span style="color:fuchsia;"><br />
</span><span style="color:maroon;">x</span><span style="color:fuchsia;">:</span><span style="color:red;">Key</span><span style="color:blue;">=&#8221;fade&#8221;&gt;</span><br />
</strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">DoubleAnimation</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=&#8221;(Ellipse.Opacity)&#8221;</span><span style="color:fuchsia;"><br />
</span></strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:fuchsia;">        </span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=&#8221;e1&#8243; </span><span style="color:red;">From</span><span style="color:blue;">=&#8221;1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">To</span><span style="color:blue;">=&#8221;0&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;</span><br />
</strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Storyboard</span><span style="color:blue;">&gt;</span><br />
</strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Canvas.Resources</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Ellipse</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Name</span><span style="color:blue;">=&#8221;e1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Canvas.Left</span><span style="color:blue;">=&#8221;100&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Canvas.Top</span><span style="color:blue;">=&#8221;0&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Canvas</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Grid</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p>The <strong>Storyboard.TargetName</strong> and <strong>Storyboard.TargetProperty</strong> target the property of the UI element that needs to be animated (in our case the Opacity property of Ellipse). We are using a DoubleAnimation because the Opacity property is of type double. The From, To and Duration values should be self-explanatory. Note that the format of the Duration property is HH:MM:SS.</p>
<p><strong>More than one animation at the same time<br />
</strong></p>
<p>The Storyboard class actually derives from ParallelTimeline, which means you can put <strong>multiple DoubleAnimations</strong> inside your Storyboard and all of them will animate in <strong>parallel</strong>. So if you wanted to move the Ellipse from x=100 to x=400 and also fade it out, you could so something like this:</p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Storyboard</span><span style="color:fuchsia;"><br />
</span><span style="color:maroon;">x</span><span style="color:fuchsia;">:</span><span style="color:red;">Key</span><span style="color:blue;">=&#8221;translateAndFade&#8221;&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">DoubleAnimation</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=&#8221;(Ellipse.Opacity)&#8221;</span><span style="color:fuchsia;"><br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:fuchsia;">        </span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=&#8221;e1&#8243; </span><span style="color:red;">From</span><span style="color:blue;">=&#8221;1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">To</span><span style="color:blue;">=&#8221;0&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">DoubleAnimation</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=&#8221;(Canvas.Left)&#8221;</span><span style="color:fuchsia;"><br />
</span></strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:fuchsia;">        </span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=&#8221;e1&#8243; </span><span style="color:red;">From</span><span style="color:blue;">=&#8221;100&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">To</span><span style="color:blue;">=&#8221;400&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;</span><br />
</strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Storyboard</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p>Note how I added an extra DoubleAnimation to do the translation. It will now animate in parallel with the fading animation.</p>
<p><strong>Playing in sequence<br />
</strong></p>
<p>What if you wanted an animation to start only after the previous one has completed? Sure, you can do it using the <strong>BeginTime</strong> property. In the previous example if we wanted the translate animation to happen after the fade completes we can do it this way:</p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">Storyboard</span><span style="color:fuchsia;"><br />
</span><span style="color:maroon;">x</span><span style="color:fuchsia;">:</span><span style="color:red;">Key</span><span style="color:blue;">=&#8221;translateAndFade&#8221;&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">DoubleAnimation</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=&#8221;(Ellipse.Opacity)&#8221;</span><span style="color:fuchsia;"><br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:fuchsia;">        </span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=&#8221;e1&#8243; </span><span style="color:red;">From</span><span style="color:blue;">=&#8221;1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">To</span><span style="color:blue;">=&#8221;0&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;</span><span style="color:maroon;">DoubleAnimation</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=&#8221;(Canvas.Left)&#8221;</span><span style="color:fuchsia;"><br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:fuchsia;">        </span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=&#8221;e1&#8243; </span><span style="color:red;">From</span><span style="color:blue;">=&#8221;100&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">To</span><span style="color:blue;">=&#8221;400&#8243;</span><span style="color:fuchsia;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span><span style="color:fuchsia;"><br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:fuchsia;">        </span><strong><span style="color:red;">BeginTime</span><span style="color:blue;">=&#8221;0:0:1&#8243;</span></strong><span style="color:fuchsia;"><br />
</span><span style="color:blue;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:blue;">&lt;/</span><span style="color:maroon;">Storyboard</span><span style="color:blue;">&gt;</span><br />
</span></p>
<p>Note that since my BeginTime has been set to &#8220;0:0:1&#8243;, it will only start after the fade-animation completes. So the total time-length of the storyboard is 2 seconds as opposed to 1 second for the previous storyboard. You can also nest ParallelTimelines and mix and match with BeginTime to achieve pretty much any sequence of animations.</p>
<p>There are also other properties on the XXXAnimation classes (XXX denotes the type like Double, Color, etc) like</p>
<ul>
<li><em>AutoReverse</em> – which automatically reverses the animation</li>
<li><em>RepeatBehavior</em> – which sets the number of times you want to repeat the animation. RepeatBehavior=&#8221;Forever&#8221; results in non-stop animation.</li>
<li><em>AccelerationRatio, DecelerationRatio</em> – easing in/out values specified as a fraction of the Duration. AccelerationRatio=&#8221;0.25&#8243; will accelerate the animation in the first quarter followed by constant-speed animation for the remaining 3/4<sup>th</sup>.</li>
</ul>
<p><strong>Using keyframes<br />
</strong></p>
<p>The animations I described earlier were of the From/To kind, where you have a starting value and an ending value. If you wanted the animation to pass through multiple states in between the start and end values, you need to use keyframe animation. Here is an example right out of the Windows SDK with the comments explaining exactly what I want to convey!</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">Ellipse</span><span style="color:blue;"><br />
</span><span style="color:red;">Width</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">200</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">Height</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">200</span>&#8220;<span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">    &lt;</span><span style="color:#a31515;">Ellipse.Fill</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">        &lt;</span><span style="color:#a31515;">SolidColorBrush</span><span style="color:blue;"><br />
</span><span style="color:red;">x:Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">MyAnimatedBrush</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">Color</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Green</span>&#8220;<span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">     &lt;/</span><span style="color:#a31515;">Ellipse.Fill</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Ellipse</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">Storyboard</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">  &lt;!&#8211;</span><span style="color:green;"> Animate from green to red using a linear key frame, from red to<br />
</span></span></p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;">  yellow using a discrete key frame, and from yellow back to green with<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:green;">  a spline key frame. This animation repeats forever. </span><span style="color:blue;">&#8211;&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">  &lt;</span><span style="color:#a31515;">ColorAnimationUsingKeyFrames<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><br />
</span><span style="color:red;">Storyboard.TargetProperty</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">(SolidColorBrush.Color)</span>&#8220;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><br />
</span><span style="color:red;">Storyboard.TargetName</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">MyAnimatedBrush</span>&#8220;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><br />
</span><span style="color:red;">Duration</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">0:0:6</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">FillBehavior</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">HoldEnd</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">RepeatBehavior</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Forever</span>&#8220;<span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">    &lt;</span><span style="color:#a31515;">ColorAnimationUsingKeyFrames.KeyFrames</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;!&#8211;</span><span style="color:green;"> Go from green to red in the first 2 seconds. LinearColorKeyFrame creates<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:green;">      a smooth, linear animation between values. </span><span style="color:blue;">&#8211;&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;</span><span style="color:#a31515;">LinearColorKeyFrame</span><span style="color:blue;"><br />
</span><span style="color:red;">Value</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Red</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">KeyTime</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">0:0:2</span>&#8220;<span style="color:blue;"> /&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;!&#8211;</span><span style="color:green;"> In the next half second, go to yellow. DiscreteColorKeyFrame creates a<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:green;">      sudden jump between values. </span><span style="color:blue;">&#8211;&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;</span><span style="color:#a31515;">DiscreteColorKeyFrame</span><span style="color:blue;"><br />
</span><span style="color:red;">Value</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Yellow</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">KeyTime</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">0:0:2.5</span>&#8220;<span style="color:blue;"> /&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;!&#8211;</span><span style="color:green;"> In the final 2 seconds of the animation, go from yellow back to green. SplineColorKeyFrame<br />
</span></span></p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;">      creates a variable transition between values depending on the KeySpline property. In this example,<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:green;">      the animation starts off slow but toward the end of the time segment, it speeds up exponentially.</span><span style="color:blue;">&#8211;&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">      &lt;</span><span style="color:#a31515;">SplineColorKeyFrame</span><span style="color:blue;"><br />
</span><span style="color:red;">Value</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Green</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">KeyTime</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">0:0:4.5</span>&#8220;<span style="color:blue;"><br />
</span><span style="color:red;">KeySpline</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">0.6,0.0 0.9,0.00</span>&#8220;<span style="color:blue;"> /&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">    &lt;/</span><span style="color:#a31515;">ColorAnimationUsingKeyFrames.KeyFrames</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">  &lt;/</span><span style="color:#a31515;">ColorAnimationUsingKeyFrames</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Storyboard</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p>The keyframe animation classes follow the same naming convention of XXXAnimationUsingKeyFrames, where XXX is the type. In the above example we are using ColorAnimationUsingKeyFrames but you could also use DoubleAnimationUsingKeyFrames when animating properties of type Double.</p>
<p><strong>Creating Custom animations<br />
</strong></p>
<p>For most cases you should be able to get away with the default animation classes. However for some cases you do need to create your own animation classes. I did a <a href="http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!230.entry">blog post</a> sometime back detailing this technique. The basic idea is that you have a &lt;Type&gt;AnimationBase class from which you derive your animation class, for eg. DoubleAnimation derives from DoubleAnimationBase. Inside the &lt;Type&gt;Animation class you override the CreateInstanceCore() Factory method that returns an instance of &lt;Type&gt;Animation. You can also define additional DependencyProperties on your animation class for further customization. The blog post I mentioned has all these details.</p>
<p>So <strong>Storyboards </strong>are pretty much the defacto way of describing animations in WPF. However you could also use DoubleAnimation or other animation classes directly without nesting inside a Storyboard. In my experience I have always found it best to have it inside a Storyboard. All the event-based triggering of animations consume Storyboards instead of &lt;Type&gt;Animation instances. I have skipped the part about creating Storyboards and animations in code but it is not much different. Since the tag-names map directly to the class-names, you could recreate the same object hierarchy in code.</p>
<p>The next post will be about Effects &#8211; the Flex way of doing animations!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=44&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/22/flex-and-wpf-a-comparison-%e2%80%93-part-3a/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Cool libraries to explore</title>
		<link>http://flexwinds.wordpress.com/2007/02/18/cool-libraries-to-explore/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/18/cool-libraries-to-explore/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 17:54:59 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/18/cool-libraries-to-explore/</guid>
		<description><![CDATA[I have been following the blogs, discussion groups and forums to collect some cool stuff people are doing with Flex and ActionScript 3. I am maintaining a list of all such libraries on my Tools page. I want to make it a central point of access for all the great stuff happening on Flex/AS3.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=43&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been following the blogs, discussion groups and forums to collect some cool stuff people are doing with Flex and ActionScript 3. I am maintaining a list of all such libraries on my <a href="http://flexwinds.wordpress.com/tools/">Tools</a> page. I want to make it a central point of access for all the great stuff happening on Flex/AS3.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=43&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/18/cool-libraries-to-explore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex + Flickr + Cairngorm</title>
		<link>http://flexwinds.wordpress.com/2007/02/17/flex-flickr-cairngorm/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/17/flex-flickr-cairngorm/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 18:56:56 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[cairngorm]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[flexapp]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/17/flex-flickr-cairngorm/</guid>
		<description><![CDATA[Surely I am one of the many who have used the above combination of libraries. I decided to make a simple app that used the Cairngorm architecture for RIA, just to get myself up to speed. The end result is below. I faced a couple of problems deploying it to my server, primarily the Security [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=39&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Surely I am one of the many who have used the above combination of libraries. I decided to make a simple app that used the <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> architecture for RIA, just to get myself up to speed. The end result is below. I faced a couple of problems deploying it to my server, primarily the Security Sandbox error. I did a blog post on that <a href="http://flexwinds.wordpress.com/2007/02/17/fixing-the-security-sandbox-errors-with-as3-flickr-api/">here</a>. I have seen some people asking about this problem on <a href="http://tech.groups.yahoo.com/group/flexcoders/">FlexCoders group</a>. Hopefully my post will be helpful to them.
</p>
<p> <a href="http://podila.net/experiments/myflickr/"><img src="http://flexwinds.files.wordpress.com/2007/02/021707-1356-flexflickr1.png?w=780" alt=""></a>
	</p>
<p>BTW, you can also view the source to see the way I have used Cairngorm.
</p>
<p>Technorati tags: <a href="http://technorati.com/tags/flex">flex</a>, <a href="http://technorati.com/tags/cairngorm">cairngorm</a>, <a href="http://technorati.com/tags/flickr">flickr</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=39&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/17/flex-flickr-cairngorm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>

		<media:content url="http://flexwinds.files.wordpress.com/2007/02/021707-1356-flexflickr1.png" medium="image" />
	</item>
		<item>
		<title>Fixing the Security Sandbox errors with AS3 Flickr API</title>
		<link>http://flexwinds.wordpress.com/2007/02/17/fixing-the-security-sandbox-errors-with-as3-flickr-api/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/17/fixing-the-security-sandbox-errors-with-as3-flickr-api/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 18:05:52 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[flexapp]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[googlecode]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/17/fixing-the-security-sandbox-errors-with-as3-flickr-api/</guid>
		<description><![CDATA[One of the recent experiments I tried was with the AS3 Flickr API. Adobe Labs has published a library called as3flickrlib on Google Code which makes it easier to access your flickr photos. So I downloaded that (using the flickr-.85.zip link under the Featured Downloads section) and started playing with it. I felt it was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=37&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the recent experiments I tried was with the AS3 Flickr API. Adobe Labs has published a library called <a href="http://code.google.com/p/as3flickrlib/">as3flickrlib</a> on Google Code which makes it easier to access your flickr photos. So I downloaded that (using the <a href="http://as3flickrlib.googlecode.com/files/flickr-.85.zip">flickr-.85.zip</a> link under the Featured Downloads section) and started playing with it. I felt it was pretty straightforward to use it, partly because I have used other Flickr libraries like <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=FlickrNet">Flickr.Net</a> for the .Net framework. </p>
<p>When developing inside Flex Builder my code worked great and I could access images and other information through the library. But when I deployed the compiled version to my server, I started getting <strong>Error#2048: Security Sandbox violation. Cannot load resource from http://flickr.com/&#8230;</strong> I knew that this error had to do something with the <em>crossdomain.xml </em>policy file that must deployed on Flickr so that external access to it is allowed. When I did a Google search on &#8220;crossdomain flickr&#8221;, I did find the policy file on <a href="http://api.flickr.com/crossdomain.xml">http://api.flickr.com/crossdomain.xml</a>. But surprisingly the domain was <strong>api.flickr.com</strong> and not <em>flickr.com</em>, as it stated in my security error. </p>
<p>After a couple more Google searches I came upon this <a href="http://tech.groups.yahoo.com/group/yws-flickr/message/2034">YahooGroups post</a> where it said that the API end-point for Flickr has changed! AHA! This made me think that the as3flickrlib must be still using the old <strong>flickr.com</strong> endpoint. Sure enough, when I opened up the source for FlickrService.as, it was using the wrong end-point. </p>
<div class="csharpcode">
<div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre>
<div><span style="color:#000000;"></span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> FlickrService extends URLLoaderBase {

</span><span style="color:#008000;">/*</span><span style="color:#008000;">*
 * The REST endpoint where we can talk with Flickr service
 </span><span style="color:#008000;">*/</span><span style="color:#000000;">
</span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> </span><span style="color:#0000FF;">const</span><span style="color:#000000;"> END_POINT:String </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&quot;</span><span style="color:#800000;">http://flickr.com/services/rest/?</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">;
</span></div>
</pre>
</div>
</div>
<p>To fix that, I looked at the sources for as3flickrlib on the Google Code Subversion repository. Interestingly <a href="http://as3flickrlib.googlecode.com/svn/trunk/src/com/adobe/webapis/flickr/FlickrService.as">FlickrService.as</a> over there was using the correct end-point (<strong>api.flickr.com</strong>). So I got hold of the sources for as3flickrlib and the dependency: <a href="http://code.google.com/p/as3corelib/">as3corelib</a>, recompiled them inside Flex Builder and generated a new <strong>as3flickrlib.swc</strong>. Using that, things started working like expected. </p>
<p>So if any of you are using the SWC from the zip file provided on as3flickrlib Google Code project, it is <strong>NOT</strong> going to work when you deploy your application online. You can use my recompiled SWC, which I have uploaded over <a href="http://podila.net/files/as3flickrlib.swc">here</a>. Ideally Adobe should be updating the build and uploading the new version. Right now the source in SVN and the compiled zip are not in sync <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> .</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/flex" rel="tag">flex</a>, <a href="http://technorati.com/tags/googlecode" rel="tag">googlecode</a>, <a href="http://technorati.com/tags/flickr" rel="tag">flickr</a>, <a href="http://technorati.com/tags/security" rel="tag">security</a>, <a href="http://technorati.com/tags/sandbox" rel="tag">sandbox</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=37&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/17/fixing-the-security-sandbox-errors-with-as3-flickr-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Papervision3D</title>
		<link>http://flexwinds.wordpress.com/2007/02/15/papervision3d/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/15/papervision3d/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 20:42:18 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[flash9]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/15/papervision3d/</guid>
		<description><![CDATA[When will I get to play with this? The demos blow me away each I time I see them. &#160; Technorati tags: flash, 3d<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=36&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When will I get to play with <a href="http://blog.papervision3d.org/">this</a>? The demos blow me away each I time I see them.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/flash" rel="tag">flash</a>, <a href="http://technorati.com/tags/3d" rel="tag">3d</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=36&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/15/papervision3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex as a DSL for Graphics</title>
		<link>http://flexwinds.wordpress.com/2007/02/15/flex-as-a-dsl-for-graphics/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/15/flex-as-a-dsl-for-graphics/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 18:49:35 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[article]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/15/flex-as-a-dsl-for-graphics/</guid>
		<description><![CDATA[One of my colleagues, John Dunne, forwarded me this interesting article by Bruce Eckel about Flex as the universal platform for application development. The article talks about the state of affairs with web technologies. It talks about HTML, Javascript, AJAX and Java Applets and describes the problems like installation issues, browser incompatibilities and UI-richness. Finally [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=35&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my colleagues, John Dunne, forwarded me this interesting <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=193593">article by Bruce Eckel</a> about Flex as the universal platform for application development. The article talks about the state of affairs with web technologies. It talks about HTML, Javascript, AJAX and Java Applets and describes the problems like installation issues, browser incompatibilities and UI-richness. Finally he settles on Flex as being the solution that overcomes all of the said problems. Check it out.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/flex" rel="tag">flex</a>, <a href="http://technorati.com/tags/web" rel="tag">web</a>, <a href="http://technorati.com/tags/graphics" rel="tag">graphics</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=35&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/15/flex-as-a-dsl-for-graphics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex and WPF: A comparison &#8211; Part 2b</title>
		<link>http://flexwinds.wordpress.com/2007/02/15/flex-and-wpf-a-comparison-part-2b/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/15/flex-and-wpf-a-comparison-part-2b/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 18:28:19 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[comparison]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/15/flex-and-wpf-a-comparison-%e2%80%93-part-2b/</guid>
		<description><![CDATA[In part-2a we saw some of the building blocks of WPF and how they are used to achieve the content-style separation. This post is a continuation and will focus on Flex&#8217;s approach. Flex has adopted the web standards right from ground up. So if you are a web developer who has had any experience with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=33&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://flexwinds.wordpress.com/2007/02/11/flex-and-wpf-a-comparison-part-2a/">part-2a</a> we saw some of the building blocks of WPF and how they are used to achieve the content-style separation. This post is a continuation and will focus on Flex&#8217;s approach. </p>
<p>Flex has adopted the web standards right from ground up. So if you are a web developer who has had any experience with HTML, CSS, Javascript it should be very natural to program in Flex. A direct one-one mapping looks like this: </p>
<p>HTML&nbsp;&#8211;&gt; <strong>MXML</strong> </p>
<p>CSS&nbsp;&#8211;&gt; <strong>CSS</strong> </p>
<p>Javascript&nbsp;&#8211;&gt; <strong>Actionscript</strong> </p>
<p>&nbsp;</p>
<p><strong>MXML markup + code-behind </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;MXML is the markup language that is used to describe the User Interface components in Flex. In concept it looks very similar to XAML, but since it is also like HTML, it has the familiar tags like &lt;mx:Script/&gt; and &lt;mx:Style/&gt;. The &lt;mx:Script/&gt; tag is used for inline code-behind whereas the &lt;mx:Style/&gt; describe the stylesheet elements for the UI elements. In a <a href="http://flexwinds.wordpress.com/2007/02/13/code-behind-in-flex-and-wpf/">previous post</a> I did a comparison of the code-behind models in Flex and WPF, which is slightly more detailed. Actionscript is the language used for the code-behind and its syntax is very similar to Javascript. </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The standard practice for describing UIs is to use MXML. Even the event-handlers are specified directly inside MXML. However it is also possible to bypass MXML completely and define the UI component completely in Actionscript. In the former approach, the MXML compiler will generate the Actionscript for you, which in turn gets compiled to SWF. </p>
<p><strong>Databinding </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Databinding is definitely my favorite feature in Flex and it is extremely powerful. It is also very easy to make your model objects bindable by including a simple metadata tag like <strong>[Bindable]</strong> against the model property or object. This is simpler than the WPF approach where you will have to implement the INotifyPropertyChanged interface for the model object and manually fire the property change notifications. In Flex just by attaching the [Bindable] metadata tag you get FREE property change notifications. Of course if you want to customize the notifications, that too is possible. What I find really interesting is the part where you bind a UI element to a model object. Say I want to bind the <strong>text</strong> property of a &lt;mx:Label/&gt; to the <strong>firstName</strong> property of the <strong>Person</strong> object. The syntax would look something like this: </p>
<p><span style="font-family:courier new;">&lt;mx:Script&gt; </span></p>
<p><span style="font-family:courier new;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;[Bindable] </strong></span></p>
<p><span style="font-family:courier new;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;var _person:Person = new Person(&#8220;Pavan&#8221;, &#8220;Podila&#8221;); </strong></span></p>
<p><span style="font-family:courier new;">&lt;/mx:Script&gt; </span></p>
<p><span style="font-family:courier new;">… </span></p>
<p><span style="font-family:courier new;">… </span></p>
<p><span style="font-family:courier new;">&lt;mx:HBox&gt; </span></p>
<p><span style="font-family:courier new;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label text=&#8221;{_person.firstName}&#8221;/&gt; </strong></span></p>
<p><span style="font-family:courier new;">&lt;/mx:HBox&gt; </span></p>
<p>&nbsp;</p>
<p>Since I made the _person instance [Bindable], the Label will automatically update its text property whenever _person.firstName changes. What is exciting is the fact that the curly braces syntax for data-binding can actually include Actionscript inside it! This is very useful in cases where I want to do a little bit of more formatting to the text. If I wanted my text to appear like &#8220;FirstName: PAVAN&#8221;, I could do this right inside the {}: </p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label text=&#8221;<strong>FirstName: {_person.firstName.toUpperCase()}</strong>&#8220;/&gt; </span></p>
<p>Doing the same in WPF would have required me to write a class that implements the IValueConverter and then pass in the instance of my model as a parameter. So the syntax would look like below. </p>
<p>[Note that I am following the C#/XAML naming conventions, so my property names have the first letter of each word capitalized: FirstName, LastName.] </p>
<p><span style="font-family:courier new;">&lt;Application.Resources&gt; </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&lt;local:StringToUpperCaseConverter x:Key=&#8221;stringConverter&#8221;/&gt; </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&lt;local:Person x:Key=&#8221;person&#8221; FirstName=&#8221;Pavan&#8221; LastName=&#8221;Podila&#8221;/&gt; </span></p>
<p><span style="font-family:courier new;">&lt;/Application.Resources&gt; </span></p>
<p><span style="font-family:courier new;"><strong>&lt;Label Content=&#8221;{Binding Path=FirstName, Converter={StaticResource stringConverter}}&#8221;/&gt; </strong></span></p>
<p>Also my converter class would look like this: </p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;[<span style="color:#2b91af;">ValueConversion</span>(<span style="color:blue;">typeof</span> (<span style="color:blue;">string</span>), <span style="color:blue;">typeof</span> (<span style="color:blue;">string</span>))] </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">StringToUpperCaseConverter</span> : <span style="color:#2b91af;">IValueConverter </span></span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;{ </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span> <span style="color:blue;">object</span> Convert(<span style="color:blue;">object</span> value, <span style="color:#2b91af;">Type</span> targetType, </span><span style="font-family:courier new;"><span style="color:blue;">object</span> parameter, <span style="color:#2b91af;">CultureInfo</span> culture) </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">string</span> firstName = (<span style="color:blue;">string</span>)value; </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">return</span> <span style="color:#a31515;">&#8220;FirstName: &#8220;</span> + firstName.ToUpper(); </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} </span></p>
<p>&nbsp;</p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span> <span style="color:blue;">object</span> ConvertBack(<span style="color:blue;">object</span> value, <span style="color:#2b91af;">Type</span> targetType, </span><span style="font-family:courier new;"><span style="color:blue;">object</span> parameter, <span style="color:#2b91af;">CultureInfo</span> culture) </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">return</span> <span style="color:blue;">null</span>; </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} </span></p>
<p><span style="font-family:courier new;">&nbsp;&nbsp;&nbsp;&nbsp;} </span></p>
<p>That definitely is a lot more typing to do than the Flex&#8217;s approach. I see this is as a major benefit in Flex which I would love to have in WPF. </p>
<p>&nbsp;</p>
<p><strong>MXML components </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;MXML components are reusable views in your application. Say you have a photo-viewer application that shows a list of photos. Each photo could be wrapped inside a MXML component that shows other information about the photo when you click on it. The view of the photo and the interaction can be captured inside this component and can be reused throughout your application. These components can also behave like the DataTemplates in WPF. You can create a property on the MXML component and set that as the model object. Inside the component you can data-bind to the properties of the model thus simulating the DataTemplate. Note that the property you create on your MXML component is your <em>DataContext</em>. </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;ItemTemplates in WPF have a direct one-one mapping with the <strong>ItemRenderer</strong>s in Flex. List based controls use the ItemRenderers to render each item in the list. Here is a simple example of an inline ItemRenderer. </p>
<p><span style="font-family:courier new;">&lt;mx:DataGridColumn headerText=&#8221;Online&#8221; dataField=&#8221;online&#8221;&gt; </span></p>
<p><span style="font-family:courier new;"><strong>&lt;mx:itemRenderer&gt; </strong></span></p>
<p><span style="font-family:courier new;"><strong>&lt;mx:Component&gt; </strong></span></p>
<p><span style="font-family:courier new;"><strong>&lt;mx:CheckBox click=&#8221;data.online=!data.online&#8221; selected=&#8221;{data.online}&#8221;/&gt; </strong></span></p>
<p><span style="font-family:courier new;"><strong>&lt;/mx:Component&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></span></p>
<p><span style="font-family:courier new;"><strong>&lt;/mx:itemRenderer&gt; </strong></span></p>
<p><span style="font-family:courier new;">&lt;/mx:DataGridColumn&gt; </span></p>
<p>&nbsp;</p>
<p>You can also create a separate MXML file, say Checkbox.mxml, that encapsulates the component. In that case you provide the name of the component to the <strong>itemRenderer</strong> property (itemRenderer=&#8221;Checkbox&#8221;, assuming Checkbox.mxml is in the same directory). </p>
<p><strong>CSS styles, skins </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Styling a Flex application means creating a CSS file (or a group of CSS files) that provides the appearance for the different UI elements. Most CSS files would include customized values for many of the UI element properties. But if you want more fine-grained control on the appearance one can also create something called the Skins. A skin file is also a CSS file but can include components from a compiled SWF file. The SWF may have custom rendered skins, also called programmatic skins. Here is a nice <a href="http://www.adobe.com/devnet/flex/articles/flex_skins_06.html">article</a> on creating skins for Flex. </p>
<p><strong>Packaging into SWC, SWF and modules </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;SWF is the final version of a compiled Flex application. It may also have a bunch of dependencies on Actionscript/Component libraries. These libraries are compiled as SWC. The other option for packaging is to use Flex Modules. Bruce Phillips did a good <a href="http://www.brucephillips.name/blog/index.cfm/2007/1/8/Example-Of-Using-Modules-In-Flex-201">post</a> on this topic and covers all the necessary material.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/wpf" rel="tag">wpf</a>, <a href="http://technorati.com/tags/flex" rel="tag">flex</a>, <a href="http://technorati.com/tags/mxml" rel="tag">mxml</a>, <a href="http://technorati.com/tags/comparison" rel="tag">comparison</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=33&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/15/flex-and-wpf-a-comparison-part-2b/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
		<item>
		<title>Code behind in Flex and WPF</title>
		<link>http://flexwinds.wordpress.com/2007/02/13/code-behind-in-flex-and-wpf/</link>
		<comments>http://flexwinds.wordpress.com/2007/02/13/code-behind-in-flex-and-wpf/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 04:16:57 +0000</pubDate>
		<dc:creator>pavanpodila</dc:creator>
				<category><![CDATA[comparison]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://flexwinds.wordpress.com/2007/02/13/code-behind-in-flex-and-wpf/</guid>
		<description><![CDATA[I should really have posted about Part 2b of my comparison of Flex and WPF, but I wish to jump ahead a little and compare the code-behind model in Flex and WPF. I am doing this because of a post I saw on Ted Patrick&#8217;s blog. Ted mentions about the code-behind model in Microsoft technologies [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=32&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I should really have posted about Part 2b of my comparison of Flex and WPF, but I wish to jump ahead a little and compare the code-behind model in Flex and WPF. I am doing this because of a <a href="http://www.onflex.org/ted/2007/02/code-behind-in-flex-2.php">post</a> I saw on <a href="http://www.onflex.org/ted/2007/02/code-behind-in-flex-2.php">Ted Patrick&#8217;s blog</a>. Ted mentions about the code-behind model in Microsoft technologies like ASP.Net and shows how you can replicate that model in Flex. ASP.Net introduced the term Code-Behind with its first release and it has become a standard way of keeping the logic separate from the UI. It is a common theme across many MS technologies including WinForms and WPF. The code-behind model follows some file-name conventions which makes it easy for Visual Designers (think VS2005) to automatically keep the UI and the code-behind in sync. </p>
<p><strong>In WPF… </strong></p>
<p>Let&#8217;s take the case of the visual designer (either <a href="http://www.microsoft.com/products/expression/en/expression-blend/default.mspx">Expression Blend</a> or <a href="http://channel9.msdn.com/wiki/default.aspx/Cider.HomePage">Cider</a>) for WPF. Since WPF uses XAML to describe the UI, the markup is kept inside <strong>&lt;your-component&gt;.xaml</strong>. The corresponding code-behind is separated out into <strong>&lt;your-component&gt;.xaml.cs</strong>. The code-behind is linked in the XAML file with the <em>x:Class</em> attribute on the root-tag. The code-generation part of the designer merges the xaml and the code-behind to create a single intermediate C# file. This file is named as <strong>&lt;your-component&gt;.designer.cs</strong>. This file is auto-generated and not meant for manual editing. The <em>.designer.cs</em> file is used for compiling to a .Net Type inside your application&#8217;s assembly. WPF is very strict about these naming conventions and also enforces the separation of UI and code-behind in separate files. In the earlier CTP releases of WPF it was possible to have inline C# code inside the XAML (using CDATA sections). However that feature has been removed from the RTM release. </p>
<p><strong>In Flex… </strong></p>
<p>Flex provides both the WPF style of code-behind (ie. Separate MXML and AS files) and the inline AS with the &lt;mx:Script/&gt; tags. This model is natural because Flex is using the standard HTML + CSS + Javascript paradigm of development. I think that makes it very flexible and it leaves to the developers to decide what is the appropriate model for them. I think most apps will use a mixture of these two approaches. Sometimes it makes sense to keep the code inline with the MXML (say for easier maintenance) and on some occasions when the code is really large the separate code-file approach works best. Ted&#8217;s <a href="http://www.onflex.org/ted/2007/02/code-behind-in-flex-2.php">post</a> talks more of the later approach.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati tags: <a href="http://technorati.com/tags/flex" rel="tag">flex</a>, <a href="http://technorati.com/tags/wpf" rel="tag">wpf</a>, <a href="http://technorati.com/tags/comparison" rel="tag">comparison</a>, <a href="http://technorati.com/tags/code-behind" rel="tag">code-behind</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexwinds.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexwinds.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexwinds.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexwinds.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexwinds.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexwinds.wordpress.com&amp;blog=739665&amp;post=32&amp;subd=flexwinds&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://flexwinds.wordpress.com/2007/02/13/code-behind-in-flex-and-wpf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cc67d54e54e1f49c9fe36513381211ee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pavanpodila</media:title>
		</media:content>
	</item>
	</channel>
</rss>
