<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The MossyBlog Times Archives 2007 - 2009 : Going Flex to Silverlight</title><link>http://blogs.msdn.com/msmossyblog/archive/tags/Going+Flex+to+Silverlight/default.aspx</link><description>Tags: Going Flex to Silverlight</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>POC #1 - Project Harmony (pt1) (Silverlight &amp; Flash)</title><link>http://blogs.msdn.com/msmossyblog/archive/2007/11/15/poc-1-project-harmony-pt1-silverlight-flash.aspx</link><pubDate>Thu, 15 Nov 2007 11:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6248634</guid><dc:creator>scbarnes</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/msmossyblog/comments/6248634.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msmossyblog/commentrss.aspx?PostID=6248634</wfw:commentRss><wfw:comment>http://blogs.msdn.com/msmossyblog/rsscomments.aspx?PostID=6248634</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="76" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb.png" width="429" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I've been enjoying the overall experience of what Silverlight has to offer since I started with Microsoft back in January 07. That being said, I've often been an internal &amp;quot;goto&amp;quot; person at times for some Flash advice on behalf of Microsoft customers around the world.&lt;/p&gt;  &lt;p&gt;In light of this, recently I also encountered a situation where a customer was looking to use both Silverlight and Flash together, something which I kind of gave a confused look at? (ie .. not because I wanted them to pick ours etc, but more to the point what was the root of the problem).&lt;/p&gt;  &lt;p&gt;The problem was simply that they had deadline to meet, they wanted to retain the video in Windows Media format but were looking to use the GUI inside Flash as a base. Fair enough, this isn't a &lt;a href="http://en.wikipedia.org/wiki/Zero-sum" target="_blank"&gt;Zero Sum Game&lt;/a&gt; and we play well with others.&lt;/p&gt;  &lt;p&gt;This isn't the first I've seen similar stories around this, but mostly its from Design shops around the world whom are keen to embrace Silverlight and Flash (fingers in both barrels) but are kind of skittish to start with (i.e. the assumption is really you have to pick a team, red vs blue).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="334" alt="Screenshot of Project Harmony" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_1.png" width="434" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Thus, I decided to put together this proof of concept, titled &amp;quot;&lt;strong&gt;&lt;font color="#ff0000"&gt;Harmony&lt;/font&gt;&lt;/strong&gt;&amp;quot;. The project is quite extensive and I'll spend the next month dissecting it and talking about different cross-sections of how you as a designer &amp;amp; developer are able to produce compelling enriching experiences with Silverlight and that you can execute on your creative vision. The rest is simply semantics and bits/bolts.&lt;/p&gt;  &lt;p&gt;In this first iteration of my &lt;strong&gt;Project &amp;quot;Harmony&amp;quot;&lt;/strong&gt; I wanted to test to see how well the performance would be in the event one was to use 90% Silverlight and 10% flash. In that overlay Flash on top of Silverlight and see what happens.&lt;/p&gt;  &lt;p&gt;The results speak for themselves, suffice to say that I really put in a lot of gratuitous animations in Silverlight to really try and break the performance overall.&lt;/p&gt;  &lt;p&gt;You can view for yourself here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.demo.members.winisp.net/poc1/" href="http://www.demo.members.winisp.net/poc1/"&gt;http://www.demo.members.winisp.net/poc1/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;(Note: Link Requires &lt;a href="http://www.silverlight.net/getstarted" target="_blank"&gt;Silverlight 1.1&lt;/a&gt; and Flash 9.x)&lt;/p&gt;  &lt;h3&gt;My Objectives for this first iteration was:&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;       &lt;h4&gt;Objectives (v1.0)&lt;/h4&gt;     &lt;/strong&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Determine to see if Flash&amp;#xA0; (Transparent windowless) degrades in performance in the event it sits on top of Silverlight.&lt;/li&gt;      &lt;li&gt;Determine if PNG overlays impact the performance of the video whilst mixed with Flash.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;strong&gt;       &lt;h4&gt;Conclusion (v1.0)&lt;/h4&gt;     &lt;/strong&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;I did see some performance degrading on both technologies, but that is mostly due to both making use of alpha transparency (I'm yet to meet a runtime of any brand that can withstand alpha transparency)&lt;/li&gt;      &lt;li&gt;Working inside Flash &amp;amp; then crossing over to Visual Studio / Expression Blend is not for the feint hearted (I kept tripping up in C# vs AS3.0 scripting syntax hooks hehe - nothing against both technologies but its more of a mind map thing).&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;strong&gt;       &lt;h4&gt;Highlights (v1.0)&lt;/h4&gt;     &lt;/strong&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Using PNG's a designer is capable of doing some interesting things to a graphical interface. In this case&amp;#xA0; used a bullet that appears to not only be embedded into the TV Screen but also shatters it.       &lt;br /&gt;        &lt;br /&gt;I also added the &amp;quot;bullets&amp;quot; in the top right corner as PNG overlay to also test how 2xOverlays inside the Video would perform.        &lt;br /&gt;        &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_16.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="80" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_7.png" width="433" border="0" /&gt;&lt;/a&gt;        &lt;br /&gt;&amp;#xA0;&lt;/li&gt;      &lt;li&gt;Using Video Reflection within Silverlight, one is able to really bring home a gloss finish by giving it a &amp;quot;glass&amp;quot; effect (as we all know there isn't enough glass effects online       &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_18.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="201" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_8.png" width="244" border="0" /&gt;&lt;/a&gt;         &lt;br /&gt;&amp;#xA0;&lt;/li&gt;      &lt;li&gt;Using an infinite loop within Silverlight, I was able to create a &amp;quot;ambiance&amp;quot; feel to the UI by making two sets of images fade in/out underneath the Flash area and the Silverlight&amp;#xA0; Video. This again, was to really see how the performance would go with a Silverlight animation underneath Flash.       &lt;br /&gt;        &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_10.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="103" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_4.png" width="433" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="115" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_3.png" width="167" align="right" border="0" /&gt;&lt;/a&gt;Using Adobe Photoshop for the bitmap artwork, I stumbled upon a technique whereby if you take a photo, duplicate its layer and then apply &amp;quot;gussian blur&amp;quot; with 50% transparency it kind of gives this glow/ambiance effect commonly seen in most games today. &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;Silverlight (Video aside of course) handles its progressive loading of assets in a unique way, I'm yet to put my finger on it but I must look into this more as I expected the GUI to take much longer to load (as there aren't any preloaders in this design).       &lt;br /&gt;        &lt;br /&gt;&amp;#xA0;&lt;/li&gt;      &lt;li&gt;The Flash Slider (ie works like iTunes) was done reasonably quickly, and the code has already been ported to Silverlight suffice to say, it looks seamlessly integrated within the GUI and unless you don't have Silverlight or Flash installed, it would argueably be forgiven as being part of one technology not 2.       &lt;br /&gt;        &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="80" alt="image" src="http://blogs.msdn.com/blogfiles/msmossyblog/WindowsLiveWriter/POC1ProjectHarmonypt1SilverlightFlash_10191/image_thumb_2.png" width="433" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;It's a small experiment at first, mainly to test the waters and see what holds together initially. &lt;/p&gt;  &lt;p&gt;The walk away message here is simple, this isn't a &lt;a href="http://en.wikipedia.org/wiki/Zero-sum" target="_blank"&gt;Zero Sum Game&lt;/a&gt; firstly and I want to stress that the most. The other impact is that if you're keen to try Silverlight but aren't quite ready for that big leap, it's ok you can use both without penalties implied. &lt;/p&gt;  &lt;p&gt;The last but most important of all, is prove your concepts initially. In that if you're looking to switch from using Flash (for whatever reason) and aren't bold enough to do the lock stock and barrel or aren't allowed to, that's ok. Establish some objectives initially, build a Proof of Concept (POC) and chip away at the idea, as you will no doubt learn both technologies limitations faster than any book can really teach you.&lt;/p&gt;  &lt;p&gt;The secret of a truly successful RIA in my opinion is knowing the technologies limitations.&lt;/p&gt;  &lt;p&gt;The next POC (pt2) I'll talk more about the JavaScript Bridge and how I was able to make the Thumbnail Slide load up the Video Playlist etc. I'm also putting together some Video Casts on not only how I made this but also will upload the code once I get it locked into &lt;a href="http://www.codeplex.com" target="_blank"&gt;Codeplex.com&lt;/a&gt; (open source). All code &amp;amp; design is hand-made by myself only.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;(&lt;strong&gt;NOTE&lt;/strong&gt;: This is a crude, raw POC and progress bars etc for both technologies aren't important for this initial purpose. They are coming, and I'll talk more about that later. Again, this is a POC so don't lock this down as some end to end final production grade solution).&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;(&lt;strong&gt;NOTE&lt;/strong&gt;: I used &lt;a href="http://www.whatistheorangebox.com/" target="_blank"&gt;Teamfortress 2&lt;/a&gt; Artwork, because it's my favorite game at the moment, I have personal history with it and well, the Soldier video is by far the funniest game trailer I've seen in quite some time. Valve Software are legends in my book - My Steam ID is &amp;quot;[te] Skittlez&amp;quot;)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Next: &lt;strong&gt;&lt;em&gt;The &amp;quot;HOW&amp;quot; (Code Dump / VideoCast).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Related Post: &lt;a title="Writing Proof of Concept RIA&amp;#x27;s" href="http://blogs.msdn.com/msmossyblog/archive/2007/11/11/writing-proof-of-concepts-ria-s.aspx"&gt;Writing Proof of Concept RIA's&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6248634" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Flash/default.aspx">Flash</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Adobe/default.aspx">Adobe</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Mashup/default.aspx">Mashup</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/RIA/default.aspx">RIA</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Going+Flex+to+Silverlight/default.aspx">Going Flex to Silverlight</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/UXE/default.aspx">UXE</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/RIA+Producer/default.aspx">RIA Producer</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Art/default.aspx">Art</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Skinning/default.aspx">Skinning</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/RIA+Handbook/default.aspx">RIA Handbook</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Animation/default.aspx">Animation</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Rich+Internet+Application/default.aspx">Rich Internet Application</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Rich+Interactive+Application/default.aspx">Rich Interactive Application</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/POC/default.aspx">POC</category></item><item><title>Going Flex to Silverlight: Understanding our DisplayList API.</title><link>http://blogs.msdn.com/msmossyblog/archive/2007/05/27/going-flex-to-silverlight-understanding-our-displaylist-api.aspx</link><pubDate>Sun, 27 May 2007 12:49:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2912920</guid><dc:creator>scbarnes</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/msmossyblog/comments/2912920.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msmossyblog/commentrss.aspx?PostID=2912920</wfw:commentRss><wfw:comment>http://blogs.msdn.com/msmossyblog/rsscomments.aspx?PostID=2912920</wfw:comment><description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Disclaimer:&lt;/u&gt;&lt;/strong&gt; This is part two of my &lt;strong&gt;&lt;/strong&gt;&lt;a href="http://blogs.msdn.com/msmossyblog/archive/tags/Going+Flex+to+Silverlight/default.aspx" target="_blank"&gt;Going Flex to Silverlight series,&lt;/a&gt; where I'll be talking about how one is able to transfer concepts they have learnt in Flex world but are looking to explore what Silverlight also has to offer. Whatever reason they have chosen, is entirely up to them and this isn't to be taken as a feature for feature comparison.&lt;/p&gt; &lt;p&gt;In the Adobe Flex (ActionScript) to create a child element/object within the code base, you would punch out something like this:&lt;/p&gt; &lt;p&gt;&lt;pre&gt;	var txt:TextField = new TextField();
	txt.x = 100;
	txt.y = 0;
	txt.text = "Click for more info...";
	addChild(txt)
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Which would then render &lt;strong&gt;MyButton&lt;/strong&gt; onto the &lt;strong&gt;DisplayObjectContainer&lt;/strong&gt; in question (provided it derives from a DisplayObject).&lt;/p&gt;
&lt;p&gt;Inside Silverlight, there is a similar approach but instead of just limiting to syntax code, one is able to piece together elements within elements through loading XAML at runtime. In that, you can access XAML pieces parked on your host, bring them in at runtime and instantiate them (children and all) through the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412361.aspx" target="_blank"&gt;CreateFromXAML&lt;/a&gt;.&amp;nbsp; example:&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;    // Retrieve a reference to the control.
    var control = sender.getHost();
    
    // Define a XAML fragment and create it.
    var xamlFragment = '&amp;lt;TextBlock Canvas.Top="200" Text="Click for more info..." /&amp;gt;&lt;textblock text="Click for more info..." canvas.top="100"&gt;';
    textBlock = control.content.createFromXaml(xamlFragment);

    // Add the XAML fragment as a child of the root Canvas object.
    sender.children.add(textBlock);

&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;As you can see, there are some similarities in approach, suffice to say that one is mode of approach. It's also important to note that you are also able to create child elements through managed code such as C# using Flex style syntax - which - can be found in both WPF and Silverlight. Yet, if you prefer JavaScript you can use the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412363.aspx" target="_blank"&gt;CreateObject(type)&lt;/a&gt; approach, which is similar I guess to the Coldfusion approach to life as well (CreateObject is used to instantiate Coldfusion Classes inside managed code).&lt;/p&gt;
&lt;p&gt;Another cool feature within the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412361.aspx" target="_blank"&gt;CreateFromXAML&lt;/a&gt; bag of tricks, is that you can also create XAML pieces loaded in via .ZIP files themselves similar to I guess Flex Modules API. This is done via &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412362.aspx" target="_blank"&gt;CreateFromXamlDownloader Method&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;pre&gt;function onDownloadCompleted(sender, eventArgs)
{
    // Determine whether the download was successful.
    if (currentDownloadProgress != 1)
    {
    	alert("Failed to succesfully download zip file");
        return;
    }

    // Retrieve the XAML content from the downloaded package file.
    var jacketBrowserXaml = sender.getResponseText("jacketBrowser.xaml");

    // Create the objects from the XAML content.
    var jacketBrowser = control.content.createFromXaml(jacketBrowserXaml);

    // Add downloaded XAML content to the control.
    sender.findName("root").children.insert(0, jacketBrowser);

    // Retrieve a reference to the Image object representing the jacket.
    var jacketImageSlice = sender.findName("jacketSlice");

    // Set the Source property of the Image object to the specific jacket image
    // within the downloaded Zip package file.
    jacketImageSlice.setSource(sender, "rotation01_green.png");
}


&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://msdn2.microsoft.com/en-us/library/Bb412362.VisualTree_05(en-us,MSDN.10).png"&gt; &lt;/p&gt;
&lt;p&gt;The children collection there after has also all the typically Method calls made available for you then to find different elements by various means. Yet, if you are unsure of where an element exists within the XAML DOM itself but do remember it's name, one is able to then use the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb188297.aspx" target="_blank"&gt;FindName&lt;/a&gt; Method&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;function onLoaded(sender, eventArgs)
{
    // Retrieve a reference to the control.
    var control = sender.getHost();

    // Retrieve a reference to the specified object.
    var object = control.content.findName("myTextBlock");

    // If a valid object reference, display an alert dialog box.
    if (object != null)
    {
        alert(object.toString() + " found");
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is also the very similar to the way Flex does it inside &lt;strong&gt;Flash.display.DisplayObjectContainer's&lt;/strong&gt; in that it would allow something along the lines of:&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;	var target:DisplayObject = container.getChildByName("myTextBlock"); 
	trace(container.getChildIndex(target)); // 0
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This however would be done on the same node level as the actual Parent of the child. The &lt;a href="http://msdn2.microsoft.com/en-us/library/bb188297.aspx" target="_blank"&gt;FindName&lt;/a&gt; method however searches the entire Silverlight hierarchy for the element that have the name you provided.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;There is a lot that Silverlight has on offer and when you dig deeper into what it has today, even in it's alpha state, there is a lot of goodness to be found. I'll continue to expose some of these gems going forward, and if you want me to discuss a topic of some kind, drop me an email on it. That being said, one thing I'd like you all to take away from this post is that the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412362.aspx" target="_blank"&gt;CreateXAMLFromDownloader&lt;/a&gt; is a massive step forward if you ask me in terms of performance / architecture design &amp;amp; development for applications should they enter the Silverlight path post its release.&lt;/p&gt;
&lt;p&gt;More Info: &lt;a title="http://msdn2.microsoft.com/en-us/library/bb412361.aspx" href="http://msdn2.microsoft.com/en-us/library/bb412361.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb412361.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2912920" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Flex/default.aspx">Flex</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Flash/default.aspx">Flash</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/XAML/default.aspx">XAML</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Going+Flex+to+Silverlight/default.aspx">Going Flex to Silverlight</category></item><item><title>Going flex to Silverlight: The basics (easy stuff first).</title><link>http://blogs.msdn.com/msmossyblog/archive/2007/05/10/going-flex-to-silverlight-the-basics-easy-stuff-first.aspx</link><pubDate>Thu, 10 May 2007 10:38:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2519165</guid><dc:creator>scbarnes</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/msmossyblog/comments/2519165.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msmossyblog/commentrss.aspx?PostID=2519165</wfw:commentRss><wfw:comment>http://blogs.msdn.com/msmossyblog/rsscomments.aspx?PostID=2519165</wfw:comment><description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This is going to probably annoy some, and signal mixed messages but overall the approach I am taking is to provide a context driven learning path on how to go from Adobe Flex coding to Microsoft Silverlight. I really don't want these posts to be fuel for the "&lt;em&gt;Flash Killer&lt;/em&gt;" BBQ's as that's counter-productive, it's intended to be more focused on helping folks whom are curious about Silverlight (for whatever reason they chose) and are about to embark on the ramp-up in learning about it.&lt;/p&gt; &lt;p&gt;It's important no matter what bloodline you come from to be at least aware of the basics of Silverlight, what it has to offer going forward and lastly how easy it may make life for you (depending on your project / context).&lt;/p&gt; &lt;p&gt;In light of this, I'll be doing a lot of these "&lt;strong&gt;&lt;em&gt;If only I knew&lt;/em&gt;&lt;/strong&gt;" style posts, as one thing I learnt very fast coming over to the Microsoft feeding tank was how easy life really is for the average .NET developer and Silverlight is no different.&lt;/p&gt; &lt;p&gt;Hopefully this won't be turned into a "&lt;em&gt;Flex vs Silverlight&lt;/em&gt;" piece but more of a way to empower Adobe Flex developers to gain an understanding of Silverlight through a more context driven discussion (e.g. "&lt;em&gt;You know how you do x in Flex right? well in Silverlight they do it this way&lt;/em&gt;")&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Namespaces&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Typically in MXML to load in controls within your project, you would do something along the lines of this:&lt;/p&gt; &lt;p&gt;&lt;em&gt;&amp;lt;mx:Application xmlns:appCntrls="com.mossyblog.controls.*"/&amp;gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&amp;lt;appCntrls:MyButton/&amp;gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Essentially, &lt;strong&gt;appCntrls:MyButton&lt;/strong&gt; is a pointer to a file in the &lt;strong&gt;com/mossyblog/controls/MyButton.as&lt;/strong&gt; (or mxml) but done so through tag based approach. It's actually quite useful in doing this as you're effectively creating your own XML vocab along with custom properties (attributes) and in Flex can even go further by nesting tags within tags (similar to DOM in essence)&lt;/p&gt; &lt;p&gt;Life in Silverlight is really no different, except when you make namespace declaration you're also telling the CLR where to compile the end result (DLL) , which is an interesting thing to note. As within Adobe Flex typically to do this you'd start to look into strategies around &lt;strong&gt;mx:Modules&lt;/strong&gt; or &lt;strong&gt;Runtime Shared Libraries&lt;/strong&gt;, which can be extremely powerful when used appropriately.&lt;/p&gt; &lt;p&gt;In Silverlight, to do this you simply type:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&amp;lt;app:MainView xmlns:app="clr-namespace:com.mossyblog.controls;assembly=MyBinDir/com.mossyblog.controls.dll"&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;There's more to this, but I'll discuss this another time (i.e. what does &lt;strong&gt;Assembly&lt;/strong&gt; mean along with the specifics of &lt;strong&gt;clr-namespace&lt;/strong&gt;)&lt;/p&gt; &lt;p&gt;&lt;u&gt;Note:&lt;/u&gt; In Adobe Flex generally the xmlns (default) points to a URI path which is consistent globally (In essence this points to the framework manifest file which in turn points to the components and their respective name / path pairs within), same deal in Silverlight only it's "&lt;a title="http://schemas.microsoft.com/client/2007" href="http://schemas.microsoft.com/client/2007"&gt;http://schemas.microsoft.com/client/2007&lt;/a&gt;" which gives the compiler the core framework reference pointer locations (will expand on this in future posts).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;GEOM / Graphic&amp;nbsp;Tags.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Inside Adobe Flex your entire tag based approach to life is driven from components that have a specific purpose (Usually not so much around Assets but more so in specific Navigation/Layout/Form style controls etc). In that you would rarely ever see the tag &lt;strong&gt;&amp;lt;Line&amp;gt;&lt;/strong&gt; as what purpose would this serve in Flex? You could easily write a .AS file called &lt;em&gt;Line.as&lt;/em&gt; which inside that uses the LineTo style approach to life (i.e. render a line using the drawing API + Flash.Geom Objects). That or you would typically use bitmap assets to handle a lot of the creative elements, but overall you have a lot of possibilities in Adobe Flex to handle this but are usually kept inside the actual components themselves.&lt;/p&gt; &lt;p&gt;In Silverlight, you're using the XAML language itself and what this means is that whenever you have a vector based&amp;nbsp;asset inside your application, you in turn will see tags that outline what that "asset" is made-up off&amp;nbsp; in terms of properties and semantically marked up description (i.e. you'll hear the words brush thrown around a lot for example).&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;eg:&lt;br&gt;&lt;em&gt;&amp;lt;Line x:Name="&lt;strong&gt;HeaderTextLine&lt;/strong&gt;" Opacity="0" X1="25" Y1="62" X2="635" Y2="62" StrokeThickness="4"&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The overall point is that you're combining the drawing tag elements with&amp;nbsp;future form/layout components and default controls as they eventually come. It can be somewhat of an initial shock as coming from a Adobe Flex environment you're typically used to seeing specific tags like Accordion, Button and so on only (also custom tags like &lt;strong&gt;&lt;em&gt;&amp;lt;MyForm&amp;gt;&lt;/em&gt;&lt;/strong&gt; etc). Silverlight offers you the same approach as this, but the important piece out of all of this to understand is that with XAML all assets are marked-up in an XML format (except if you prefer to use bitmap of course).&lt;/p&gt; &lt;p&gt;Basic stuff right? (Let me know if that did not make sense).&lt;/p&gt; &lt;p&gt;However, you really don't need to be to worried about the specifics of hand-coding these tags, as Expression Blend for example takes over that burden and automagically spits this out into inline code for you (yay!). This is good thing as if you're a code nutter like me, you can wrap these pieces into composite components, which house the XAML code within (just like you'd make your own MXML component out of the Adobe Flex Framework primitives etc).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Next Post..&lt;/strong&gt; &lt;em&gt;Code-behinds and XAML&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;P.S&lt;br&gt;If there is a part of Silverlight you want me to cover in this "How to" approach, please leave comments as I'll do it! :)&lt;/em&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2519165" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Flex/default.aspx">Flex</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Flash/default.aspx">Flash</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Adobe/default.aspx">Adobe</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/XAML/default.aspx">XAML</category><category domain="http://blogs.msdn.com/msmossyblog/archive/tags/Going+Flex+to+Silverlight/default.aspx">Going Flex to Silverlight</category></item></channel></rss>