<?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>Adam Nathan's Blog : Hearts</title><link>http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx</link><description>Tags: Hearts</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>XAML *Video* Playing Cards</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/09/16/463224.aspx</link><pubDate>Fri, 16 Sep 2005 20:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463224</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/463224.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=463224</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=463224</wfw:comment><description>On XAMLshare I just put the &lt;A href="http://xamlshare.com/default.aspx/Objects/VideoPlayingCards.html"&gt;source for the video playing cards&lt;/A&gt; I&amp;nbsp;showed in my PDC talk and on &lt;A href="http://channel9.msdn.com/showpost.aspx?postid=114690"&gt;the Channel 9 video&lt;/A&gt;: 
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;IMG src="http://pinvoke.net/blog/images/videocards.png"&gt;&lt;/P&gt;
&lt;P&gt;Put the XAML inside XAMLPad (Beta 1) and qualify the .wmv references with their full path.&amp;nbsp; Enjoy!&lt;/P&gt;
&lt;P&gt;Tags: &lt;A href="http://technorati.com/tag/pdc" rel=tag&gt;PDC&lt;/A&gt;, &lt;A href="http://technorati.com/tag/pdc05" rel=tag&gt;PDC05&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=463224" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Announcing www.winfxhearts.com!</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/09/08/462190.aspx</link><pubDate>Thu, 08 Sep 2005 17:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462190</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>19</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/462190.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=462190</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=462190</wfw:comment><description>&lt;P&gt;To correspond with &lt;A href="http://commnet.microsoftpdc.com/content/sessionview.aspx?TopicID=5380e71b-7cc8-4c36-a846-d422cfd73eac"&gt;my PDC talk&lt;/A&gt; about making an application "light up" on Windows Vista, I've created &lt;A href="http://www.winfxhearts.com/"&gt;www.winfxhearts.com&lt;/A&gt;.&amp;nbsp; This site has a ClickOnce link that enables you can play a version of my new &amp;amp; improved Internet Hearts game.&amp;nbsp; Here's a "before &amp;amp; after" look:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="http://www.winfxhearts.com/"&gt;&lt;IMG src="http://pinvoke.net/blog/images/thegamesmall.png" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is still the good ol' Win32 application, but with a dramatically different user experience thanks to WPF and ClickOnce.&amp;nbsp; In the screenshot above, the reddish part of the new UI uses WPF (Avalon), but the chat window, menus, etc. are still Win32.&amp;nbsp; And of course the game logic is still the same.&amp;nbsp; There's no need to rewrite it!&lt;/P&gt;
&lt;P&gt;Again, I promise to blog more details after the &lt;a href="http://technorati.com/tag/pdc" rel="tag"&gt;PDC&lt;/a&gt; (and not just about Avalon &amp;amp; ClickOnce, but Indigo, Windows Vista, plus the experiences of upgrading to VC8 &amp;amp; using /CLR).&amp;nbsp; In the meantime, go ahead and try the game, or look for the Channel 9 video about WinFX Hearts &amp;amp; WPF (scheduled to appear on Monday).&lt;/P&gt;
&lt;P&gt;You can play this version on Windows Vista Beta 1, Windows XP, or Windows Server 2003, as long as &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=CE888B4C-CCBD-452F-9D90-F4B7190CCA24&amp;amp;displaylang=en"&gt;WinFX Beta 1&lt;/A&gt; is installed (and a post-Beta 2 version of the .NET Framework is &lt;EM&gt;not &lt;/EM&gt;installed).&amp;nbsp; If you're going to &lt;a href="http://technorati.com/tag/pdc05" rel="tag"&gt;PDC05&lt;/a&gt;, you can play the game on machines in the "Windows Vista Test Drive" Commnet area through Tuesday (9/13).&lt;/P&gt;
&lt;P&gt;Sure, it's not as popular a game as Solitaire or &lt;a href="https://blogs.msdn.com:443/oldnewthing/archive/2005/09/05/461035.aspx"&gt;Spider Solitaire&lt;/A&gt;, but hopefully the opportunity to play humans&amp;nbsp;is an incentive.&amp;nbsp; Before entering a game, you get to choose a name and a picture (either a standard one or any image on the web!):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;IMG src="http://winfxhearts.com/logon.png"&gt;&lt;/P&gt;
&lt;P&gt;The game doesn't begin until four players have joined, so you might have to wait awhile to play (or convince some friends to join at the same time)!&lt;/P&gt;
&lt;P&gt;Post any questions/issues/comments here.&amp;nbsp; Enjoy!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=462190" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Managed+Code/default.aspx">Managed Code</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Back to Internet Hearts</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/08/24/455721.aspx</link><pubDate>Wed, 24 Aug 2005 21:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:455721</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/455721.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=455721</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=455721</wfw:comment><description>&lt;P&gt;&lt;A href="http://radio.weblogs.com/0001011/"&gt;Scoble&lt;/A&gt; and &lt;A href="http://channel9.msdn.com/User/Profile.aspx?UserID=22661"&gt;Ernie Booth&lt;/A&gt;&amp;nbsp;stopped by my office today with their camcorder so I could talk about and demo Internet Hearts -- now with the power of WPF! -- for an upcoming Channel 9 video.&amp;nbsp; Look for it during the PDC timeframe.&amp;nbsp; I've been so busy preparing for the PDC that I've been slacking on blogging about the Internet Hearts migration experience.&amp;nbsp; Sorry!&amp;nbsp; But I should be ready to blog about it more right after the PDC.&lt;/P&gt;
&lt;P&gt;Oh yeah, "WPF" seems like it's going to be the winning term, rather than "WinPF."&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=455721" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Migrating from VC6 to VC8: Resources</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/07/15/439342.aspx</link><pubDate>Fri, 15 Jul 2005 20:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:439342</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/439342.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=439342</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=439342</wfw:comment><description>&lt;P&gt;In order to &lt;a href="http://blogs.msdn.com/adam_nathan/archive/2005/05/02/414174.aspx"&gt;update Internet Hearts with WinFX features&lt;/A&gt;, I'm going to leverage C++ Interop and recompile at least some of the source code with /clr so I can start using managed APIs.&amp;nbsp; Therefore, my first step was to get the source code (which hadn't been touched in about 6 years) building with Visual C++ 2005 (aka "VC8").&amp;nbsp; Yes, I could have kept pieces compiling with VC6.&amp;nbsp; Or I could have changed my approach to keep using VC6 everywhere and leverage PInvoke or COM Interop instead of C++ Interop.&amp;nbsp; But C++ Interop is the most natural choice for this project... plus I want my &lt;EM&gt;unmanaged &lt;/EM&gt;code to get the benefits of the latest &amp;amp; greatest VC compiler.&amp;nbsp; Don't be fooled into thinking that Visual C++ 2005 is only interesting for managed code!&lt;/P&gt;
&lt;P&gt;Of course, the jump from VC6 to VC8 is pretty large.&amp;nbsp; A lot has happened in those 7 (or is it 8?) years!&amp;nbsp; Actually, the biggest adjustment is going from VC6 to VC7.1, due to significantly increased compliance with ANSI/ISO standards, resulting in breaking changes.&amp;nbsp; But if you've already made the jump to VC7.1, moving to VC8 should be much easier.&amp;nbsp; The biggest change you'll notice when moving to VC8 is probably the &lt;A href="http://msdn2.microsoft.com/library/8ef0s5kh(en-us,vs.80).aspx"&gt;CRT Security Enhancements&lt;/A&gt;, which will likely give you &lt;EM&gt;lots &lt;/EM&gt;of deprecation warnings.&lt;/P&gt;
&lt;P&gt;Next time I'll discuss what challenges I ran into upgrading the Internet Hearts codebase, but in the meantime I've done some navigating of the maze known as MSDN, and came up with the following list of migration resources.&amp;nbsp; I just hope that these funky URLs will be a little more permanent than most permalinks I've tried to rely on!&lt;/P&gt;
&lt;P&gt;Overviews:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/bw65k95a(en-us,vs.80).aspx"&gt;What's new in 8.0&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/7223w6b0(en-us,vs.80).aspx"&gt;What's new in 7.1&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/2byy0fh6(en-us,vs.80).aspx"&gt;What's new in 7.0&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Moving from 6.0 to 7.1:&lt;BR&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/w1sc4t4k(en-us,vs.80).aspx"&gt;ATL/MFC Breaking changes (6.0 to 7.0)&lt;/A&gt;&amp;nbsp;(also seen &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vclrfatlcompatibilityissues.asp"&gt;here&lt;/A&gt;&amp;nbsp;but the list isn't as long) 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vclrfatlcompatibilityissues.asp"&gt;ATL/MFC Breaking changes (7.0 to 7.1)&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/zzz7ct0s(en-us,vs.80).aspx"&gt;Standard C++ Library changes&lt;/A&gt;&amp;nbsp;and &lt;A href="http://msdn2.microsoft.com/library/8h8eh904(en-us,vs.80).aspx"&gt;issues specific to upgrading&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/ms177251(en-us,vs.80).aspx"&gt;Compiler breaking changes&lt;/A&gt; 
&lt;LI&gt;In-depth info on &lt;A href="http://msdn2.microsoft.com/library/txbse2cf(en-us,vs.80).aspx"&gt;increased standards compliance&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/kyb7zzw4(en-us,vs.80).aspx"&gt;Project upgrading&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Moving from 7.1 to 8.0:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/y8bt6w34(en-us,vs.80).aspx"&gt;Libraries breaking changes&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/k3aehyyf(en-us,vs.80).aspx"&gt;ATL obsolete topics and deprecated functions with replacements&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/96kas566(en-us,vs.80).aspx"&gt;MFC obsolete topics&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/ms177253(en-us,vs.80).aspx"&gt;Compiler breaking changes&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/z8dh4h17(en-us,vs.80).aspx"&gt;Deprecated compiler options&lt;/A&gt; 
&lt;LI&gt;Some removed linker options (mentioned &lt;A href="http://msdn2.microsoft.com/library/hx072wbd(en-us,vs.80).aspx"&gt;here&lt;/A&gt; and &lt;A href="http://msdn2.microsoft.com/library/cx002e0b(en-us,vs.80).aspx"&gt;here&lt;/A&gt;) 
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/library/e54ke6de(en-us,vs.80).aspx"&gt;Preprocessor changes&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=439342" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Managed+Code/default.aspx">Managed Code</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>PDC talk descriptions &amp; the game of Hearts</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/07/14/438850.aspx</link><pubDate>Thu, 14 Jul 2005 20:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:438850</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/438850.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=438850</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=438850</wfw:comment><description>&lt;P&gt;Today Raymond talks about &lt;a href="http://blogs.msdn.com/oldnewthing/archive/2005/07/14/438836.aspx"&gt;marketing tweaking PDC talk descriptions&lt;/A&gt;&amp;nbsp;&lt;EM&gt;and &lt;/EM&gt;some &lt;a href="http://blogs.msdn.com/oldnewthing/archive/2005/07/14/438774.aspx"&gt;little-known history on Microsoft Hearts&lt;/A&gt;, both of which made me smile since I'm&amp;nbsp;going to be doing a PDC talk primarily based on &lt;a href="http://blogs.msdn.com/adam_nathan/archive/2005/05/02/414174.aspx"&gt;my Internet Hearts project&lt;/A&gt;.&amp;nbsp; Of course,&amp;nbsp;&lt;EM&gt;Internet&lt;/EM&gt; Hearts (which appeared in Windows XP) is a separate codebase from Hearts, and you get to play real (but nameless) people.&amp;nbsp; Whereas Hearts, despite prompting you to log on to "the Microsoft Hearts Network," doesn't have anything to do with the network.&amp;nbsp; If you disable your Internet connection, Pauline, Michele, and Ben are still there to play you!&lt;/P&gt;
&lt;P&gt;But on to the topic of PDC talk descriptions, you can find mine at &lt;A href="http://commnet.microsoftpdc.com/content/sessions.aspx"&gt;http://commnet.microsoftpdc.com/content/sessions.aspx&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;DIV class=sessionTitle&gt;&lt;STRONG&gt;Longhorn: A Case Study on How Your Application Takes Advantage of Longhorn&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class=sessionAbstract&gt;Wondering how to integrate Avalon for rich UI, Indigo for flexible communication and other great Longhorn features into your application? Want to see what's really involved in making your software "light up on Longhorn?" Using a special version of the Internet Hearts game as a case study, this session highlights strategies and best practices in augmenting large Win32 code bases to incrementally take advantage of new WinFX and Longhorn-specific functionality.&lt;/DIV&gt;
&lt;DIV class=catalog_item&gt;&lt;SPAN class=catalog_itemlbl&gt;Session Level(s): &lt;/SPAN&gt;300&lt;/DIV&gt;
&lt;DIV class=catalog_item&gt;&lt;SPAN class=catalog_itemlbl&gt;Track(s): &lt;/SPAN&gt;Fundamentals&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you may have guessed, this bares little resemblance to any of my original title suggestions, although the description is mostly still intact.&amp;nbsp; What do you think?&amp;nbsp; Does this sound like a talk you would want to see, or is the title too dry?&amp;nbsp; Is the focus on Longhorn confusing since a lot of the content will be WinFX (which works on XP)?&amp;nbsp; Would you have guessed that WinFX Interop is an important component of this talk?&amp;nbsp; Any feedback you share&amp;nbsp;could be helpful ammunition for making some improvements here, so feel free! :)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=438850" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Internet Hearts: 112,000 Lines of Code</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/06/15/429446.aspx</link><pubDate>Wed, 15 Jun 2005 23:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:429446</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/429446.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=429446</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=429446</wfw:comment><description>&lt;P&gt;On Monday &lt;a href="http://blogs.msdn.com/adam_nathan/archive/2005/06/13/428610.aspx"&gt;I asked for guesses on the size of the Internet Hearts source base&lt;/A&gt;, and the highest (public) one was 45,000 lines of code.&amp;nbsp; The answer: approximately &lt;STRONG&gt;112,000&lt;/STRONG&gt; lines of code!&amp;nbsp; 51,000 are client-specific, 35,000 are server-specific, and 26,000 are shared by both.&lt;/P&gt;
&lt;P&gt;Higher than you expected? Well, there's a lot of functionality on the server end. And the application is actually a general-purpose game client &amp;amp; server designed to support multiple games (Internet Backgammon/Checkers/Hearts/Reversi/Spades).&amp;nbsp; For the purpose of turning this app into a shareable sample, I've already removed the non-Hearts pieces, but the generic nature of the architecture definitely contributes to the code size.&lt;/P&gt;
&lt;P&gt;When I apply today's technologies to this older code base, I'm pretty sure I'll be able to "do more with less":&amp;nbsp; Less lines of code, less time &amp;amp; effort, less bugs, etc.&amp;nbsp; So we should see the application shrink.&lt;/P&gt;
&lt;P&gt;Here are some diagrams to illustrate how the baseline Internet Hearts application is structured (prior to any improvements).&amp;nbsp; The orange-colored components involve UI, so they're candidates for an Avalon makeover.&amp;nbsp; The indigo-colored components involve networking, so they're candidates for... you guessed it... Indigo!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Client:&lt;/STRONG&gt;&lt;/P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/heartsclient.gif"&gt; 
&lt;P&gt;&lt;STRONG&gt;The Server:&lt;/STRONG&gt;&lt;/P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/heartsserver.gif"&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=429446" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Managed+Code/default.aspx">Managed Code</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Internet Hearts: Guess the LOC</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/06/13/428610.aspx</link><pubDate>Mon, 13 Jun 2005 22:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:428610</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/428610.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=428610</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=428610</wfw:comment><description>&lt;P&gt;TechEd made me gain about 5 pounds, and my bag somehow gained 20 pounds.&amp;nbsp; (And I didn't get a single piece of &lt;A href="http://www.urbandictionary.com/define.php?term=swag"&gt;swag&lt;/A&gt; from the Product Pavilion, I swear.)&amp;nbsp; But I'm back in Redmond after a &lt;STRONG&gt;24-hour journey&lt;/STRONG&gt; from Orlando to Seattle, due to delays at Chicago O'Hare.&amp;nbsp; I was intrigued that at the beginning of each flight, United plugged (the original) Channel 9.&amp;nbsp; Perhaps they're starting to appreciate some &lt;a href="http://blogs.msdn.com/jledgard/archive/2005/01/04/346404.aspx"&gt;corporate transparency&lt;/A&gt;, too?&amp;nbsp; Now if United (or any other airline) employees started blogging, that would be interesting...&lt;/P&gt;
&lt;P&gt;Anyway, as I mentioned right before TechEd, I now have the source code to &lt;a href="http://blogs.msdn.com/adam_nathan/archive/2005/05/02/414174.aspx"&gt;Internet Hearts&lt;/A&gt;, and will blog about a few of the challenges in integrating new WinFX functionality.&amp;nbsp; But first, &lt;STRONG&gt;can you guess how many lines of code comprise this application&lt;/STRONG&gt; (client and server)?&lt;/P&gt;
&lt;P&gt;Some clues: It's a C++ winsock application.&amp;nbsp; It hasn't been touched since around 1999.&amp;nbsp; It uses ATL &amp;amp; WTL.&amp;nbsp; You can explore the client's functionality (on the "Games" menu) if you've got Windows XP.&amp;nbsp; And to be clear, I'm talking about the &lt;EM&gt;card game&lt;/EM&gt;.&amp;nbsp; When I mentioned Internet Hearts to &lt;a href="http://blogs.msdn.com/cbrumme/"&gt;Chris Brumme&lt;/A&gt;, he wondered if I was talking about an online dating service! :)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=428610" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Avalon Beta 1 RC Breaking Changes</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/06/01/423894.aspx</link><pubDate>Wed, 01 Jun 2005 22:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:423894</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/423894.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=423894</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=423894</wfw:comment><description>&lt;P&gt;Breaking changes are a fact of life when living on the &lt;A href="http://en.wikipedia.org/wiki/Bleeding_edge"&gt;bleeding edge&lt;/A&gt; of betas and CTPs, especially for technologies like Avalon and Indigo which haven't officially shipped yet.&amp;nbsp; There have been lots of changes between the March CTP and Beta 1 RC, and there will be lots more to come.&amp;nbsp; Remembering the CLR/.NET Framework changes between Beta 1, Beta 2, and the RTM of v1.0, I know we're still in for quite a ride!&amp;nbsp; At least this time I don't have to try to keep a 1600-page book in sync with all the changes! :)&amp;nbsp; Good luck, &lt;A href="http://simplegeek.com/"&gt;Chris&lt;/A&gt; and &lt;A href="http://sellsbrothers.com/"&gt;Chris&lt;/A&gt;!&lt;/P&gt;
&lt;P&gt;I thought I'd share the changes I ran into with my &lt;A href="http://xamlshare.com/default.aspx/Objects/PlayingCardHand.html"&gt;playing cards sample&lt;/A&gt;&amp;nbsp;as I moved it from the March CTP to Beta 1 RC.&lt;/P&gt;
&lt;P&gt;In source code, the only change I made (in Hand.xaml.cs) was to make Hand derive from Viewbox rather than Grid.&amp;nbsp; I could have left it alone, but it felt more natural to have Hand &lt;EM&gt;be&lt;/EM&gt; a Viewbox rather than a Grid &lt;EM&gt;containing &lt;/EM&gt;a Viewbox.&amp;nbsp; The March CTP compiler had prevented me from doing the former.&lt;/P&gt;
&lt;P&gt;Of the four XAML files in the &lt;A href="http://www.pinvoke.net/blog/downloads/CardsBeta1RC.zip"&gt;complete sample&lt;/A&gt;, I only had to change one of them (Card.xaml).&amp;nbsp; But there were lots of changes, indeed:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;x:StyleID&lt;/STRONG&gt; changed to &lt;STRONG&gt;Name&lt;/STRONG&gt; 
&lt;LI&gt;&lt;STRONG&gt;TransformCollection&lt;/STRONG&gt; changed to &lt;STRONG&gt;TransformGroup&lt;/STRONG&gt; 
&lt;LI&gt;&lt;STRONG&gt;*Alias(Target=Background)&lt;/STRONG&gt; changed to &lt;STRONG&gt;{TemplateBinding Background}&lt;/STRONG&gt; 
&lt;LI&gt;&lt;STRONG&gt;SourceId&lt;/STRONG&gt; and &lt;STRONG&gt;TargetId&lt;/STRONG&gt; (in EventTriggers) changed to &lt;STRONG&gt;SourceName&lt;/STRONG&gt; and &lt;STRONG&gt;TargetName&lt;/STRONG&gt; 
&lt;LI&gt;&lt;STRONG&gt;DeactivateAction&lt;/STRONG&gt; (in EventTriggers) changed to &lt;STRONG&gt;StopAction&lt;/STRONG&gt; 
&lt;LI&gt;On the ParellelTimelines, I had to play around with Duration and FillBehavior settings to get the desired effects when pairing the MouseEnter/MouseLeave animations.&amp;nbsp; It was hard to get right, but there should be some changes in this area in the future to make things easier. 
&lt;LI&gt;I had to alter the paths in my SetterTimelines in order to animate my transforms.&amp;nbsp; For example, (Grid.RenderTransform)[0].(RotateTransform.Angle) changed to (Grid.RenderTransform)&lt;STRONG&gt;.(TransformGroup.Children)&lt;/STRONG&gt;[0].(RotateTransform.Angle) 
&lt;LI&gt;In all of my DrawingBrushes, I removed the Viewbox attribute (Viewbox="0 0 1468 2053").&amp;nbsp; Another option would have been to set &lt;STRONG&gt;ViewboxUnits="Absolute"&lt;/STRONG&gt;.&amp;nbsp; Why?&amp;nbsp; The meaning of the coordinates has changed, with the default now being ViewboxUnits="RelativeToBoundingBox".&amp;nbsp; But since the coordinates now get calculated automatically if you don't specify them, I just removed them altogether. 
&lt;LI&gt;On the button, &lt;STRONG&gt;ID changed to Name&lt;/STRONG&gt;.&amp;nbsp; This was a big change to FrameworkElements that all Avalon components are likely to run into.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There were a lot more breaking changes that my sample managed to avoid because there were two ways to do certain things in the March CTP and now there's only one way to do them.&amp;nbsp; I chose the way that survived the upgrade, but you could easily run into these changes.&amp;nbsp; For example:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The deprecated attribute syntax &lt;A href="http://msdn.microsoft.com/longhorn/?pull=/library/en-us/dnlong/html/avalonmarch2005ctp.asp"&gt;described here&lt;/A&gt;&amp;nbsp;(such as using&amp;nbsp;&lt;STRONG&gt;*null&lt;/STRONG&gt; instead of &lt;STRONG&gt;{x:Null}&lt;/STRONG&gt;) was still supported in the March CTP, but not in Beta 1 RC.&amp;nbsp; Upgrading means you're now forced to make the switch. 
&lt;LI&gt;You can no longer use System.Windows.Shapes inside of a DrawingBrush.&amp;nbsp; Instead, you must use the new Drawing classes: DrawingGroup, GeometryDrawing, &amp;amp; ImageDrawing.&amp;nbsp; This is a big change, but it has lots of benefits.&amp;nbsp; A DrawingBrush can now exist in a Resources dictionary, and since the Drawing classes inherit from Animatable (rather than FrameworkElement), a lot of properties are removed (which were never supported inside a DrawingBrush anyway), giving a much smaller memory footprint. 
&lt;LI&gt;There have been a number of changes to the way styles are defined.&amp;nbsp; For example, you no longer embed controls or a VisualTree inside them.&amp;nbsp; You set properties, such as the "Template" property, which holds a ControlTemplate much like what the VisualTree used to be.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Are you struggling with any other breaking changes that I didn't cover?&amp;nbsp; Let me know and I'll see if I can help!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=423894" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>XAML Playing Cards</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/05/03/414148.aspx</link><pubDate>Tue, 03 May 2005 22:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:414148</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>37</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/414148.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=414148</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=414148</wfw:comment><description>&lt;P&gt;Looking at the card games that ship with Windows XP, I think one of the most obvious opportunities for improvement is the&amp;nbsp;look &amp;amp; feel of the playing cards.&amp;nbsp; These games use a shared library known as&amp;nbsp;&lt;A href="http://www.pinvoke.net/jump.aspx/cards.cdtdraw"&gt;cards.dll&lt;/A&gt; to draw cards that look like... um... this:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/win32cards.gif" &lt; P&gt; 
&lt;P&gt;Don't those look &lt;EM&gt;so &lt;/EM&gt;20th century?&amp;nbsp; To prepare for &lt;a href="http://blogs.msdn.com/adam_nathan/archive/2005/05/02/414174.aspx"&gt;migrating Internet Hearts&lt;/A&gt;, I've created an Avalon Playing Card control with built-in animations:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/card.gif"&gt;&lt;/P&gt;
&lt;P&gt;It can be set to any of the 52 cards (although no jokers currently).&amp;nbsp; I've also created a "Hand" control that mimics the hand dealt in the Win32 picture above:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/cardhand2.gif"&gt;&lt;/P&gt;
&lt;P&gt;And, of course, since they're vector graphics, they look just as good no matter how much you zoom in:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.pinvoke.net/blog/images/bigcard.gif"&gt;&lt;/P&gt;
&lt;P&gt;You can &lt;A href="http://pinvoke.net/blog/downloads/CardsMarchCTP.zip"&gt;get the source code here&lt;/A&gt;, which is compatible with the &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=85ab132b-f1aa-4422-b053-272d79863013&amp;amp;displaylang=en"&gt;March CTP of Avalon&lt;/A&gt;.&amp;nbsp; I'll post new versions as new builds of Avalon get released.&lt;/P&gt;
&lt;P&gt;The .zip file contains a Visual Studio solution with two projects:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Cards&lt;/STRONG&gt;, which builds Cards.dll containing the Card and Hand controls pictured above 
&lt;LI&gt;&lt;STRONG&gt;Demo&lt;/STRONG&gt;, a simple application demonstrating the use of the controls&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In the Cards project, Cards.xaml defines the playing card control, which is just a button styled to look like a card: &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;lt;Button Name="CardButton" Style="{StaticResource Card}" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The style consists of a Viewbox (to enable scaling while maintaining the proper aspect ratio) and two rectangles: one painted with the desired card face and one painted with a shadow.&amp;nbsp; This painting is done with DrawingBrushes defined in the same file.&amp;nbsp; There are 53 of them: one per card face and one for the shadow.&amp;nbsp; For example, here's my DrawingBrush for the 2 of Hearts: &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face="Courier New" color=#a52a2a size=1&gt;&amp;nbsp;&amp;lt;DrawingBrush x:Key="H2" Stretch="Uniform" Viewbox="0 0 1468 2053"&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp; &amp;lt;DrawingBrush.Drawing&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp; &amp;lt;DrawingGroup&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DrawingGroup.Children&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FFFFFF" Geometry="M1467.5,1852.5c0,110-90,200-200,200h-1067c-110,0-200-90-200-200v-1652 c0-110,90-200,200-200h1067c110,0,200,90,200,200V1852.5z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Geometry="M1467.5,1852.5c0,110-90,200-200,200h-1067c-110,0-200-90-200-200v-1652 c0-110,90-200,200-200h1067c110,0,200,90,200,200V1852.5z"&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#a52a2a&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing.Pen&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&amp;lt;Pen Brush="#000000" /&amp;gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&amp;lt;/GeometryDrawing.Pen&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GeometryDrawing&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Geometry="M1080.5,1402.5c0,110-90,200-200,200h-293 c-110,0-200-90-200-200v-797c0-110,90-200,200-200h293c110,0,200,90,200,200V1402.5z"&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#a52a2a&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing.Pen&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&amp;lt;Pen Brush="#636BC1" Thickness="27" /&amp;gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&amp;lt;/GeometryDrawing.Pen&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GeometryDrawing&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#a52a2a&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M63.709,718.157c-5.067-10.677-13.2-26.4-15.6-37.2c-7.2-27.6-14.4-60-6-88.8 c13.2-45.6,69.6-62.4,111.6-44.4c18,7.2,27.6,26.4,32.4,45.6c1.2,2.4,4.8,2.4,6,0c3.6-25.2,21.6-46.8,45.6-51.6 c48-8.4,88.8,26.4,94.8,72c4.8,38.4-8.4,74.4-27.6,108c-37.2,67.2-75.6,129.6-116.4,193.2 C140.51,854.957,97.31,788.957,63.709,718.157z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M1406.117,1334.843c5.066,10.677,13.199,26.4,15.6,37.199 c7.199,27.601,14.4,60,6,88.801c-13.2,45.6-69.6,62.399-111.6,44.4c-18-7.201-27.601-26.4-32.4-45.601 c-1.2-2.399-4.801-2.399-6,0c-3.6,25.2-21.6,46.8-45.6,51.601c-48,8.399-88.801-26.4-94.801-72c-4.8-38.4,8.4-74.4,27.6-108 c37.201-67.201,75.601-129.601,116.4-193.2C1329.316,1198.042,1372.517,1264.042,1406.117,1334.843z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M97.5,210.5L56.25,215c-1.5-8.414-2.25-16.43-2.25-24.039 c0-23.313,4.664-43.594,14.008-60.836s23.734-31.492,43.172-42.742S152.227,70.5,175.992,70.5 c21.836,0,41.578,4.891,59.234,14.656c17.656,9.773,30.945,22.414, 39.875,37.914c8.93,15.508,13.398,31.82,13.398,48.938 c0,17.281-3.164,33.438-9.492,48.453c-7.016,16.797-18.461,33.031-34.344,48.695c-15.883,15.672-47.891,40.781-96.016,75.344 h69.313c11.281,0,18.43-0.68,21.461-2.047c3.023-1.367,5.633-4.063,7.836-8.086s4.055-10.945,5.57-20.766l1.648-11.102H294.5 l-18.734,124h-27.18l-2.469-12H56.5v-46.766c27.875-21.32,63.242-52.82,106.086-94.5c21.969-21.32,36.602-39.734,43.883-55.242 c5.352-11.313,8.031-23.188,8.031-35.625c0-14.375-5.063-26.523-15.188-36.461S175.648,131,158.703,131 c-12.539,0-23.422,2.711-32.656,8.125s-16.461,13.133-21.695,23.148S96.5,182.875,96.5,194.016 C96.5,198.063,96.828,203.555,97.5,210.5z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M1370.5,1842.5l41.25-4.5c1.5,8.414,2.25,16.43,2.25,24.039 c0,23.313-4.664,43.594-14.008,60.836s-23.734,31.492-43.172,42.742s-41.047,16.883-64.813,16.883 c-21.836,0-41.578-4.891-59.234-14.656c-17.656-9.773-30.945-22.414-39.875-37.914c-8.93-15.508-13.398-31.82-13.398-48.938 c0-17.281,3.164-33.438,9.492-48.453c7.016-16.797,18.461-33.031,34.344-48.695c15.883-15.672,47.891-40.781,96.016-75.344 h-69.313c-11.281,0-18.43,0.68-21.461,2.047c-3.023,1.367-5.633,4.063-7.836,8.086s-4.055,10.945-5.57,20.766l-1.648,11.102 H1173.5l18.734-124h27.18l2.469,12H1411.5v46.766c-27.875,21.32-63.242,52.82-106.086,94.5 c-21.969,21.32-36.602,39.734-43.883,55.242c-5.352,11.313-8.031,23.188-8.031,35.625c0,14.375,5.063,26.523,15.188,36.461 s23.664,14.906,40.609,14.906c12.539,0,23.422-2.711,32.656-8.125s16.461-13.133,21.695-23.148s7.852-20.602,7.852-31.742 C1371.5,1854.938,1371.172,1849.445,1370.5,1842.5z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M675.605,575.327c-2.534-5.338-6.6-13.199-7.8-18.6c-3.601-13.8-7.2-30-3-44.4 c6.6-22.799,34.8-31.199,55.8-22.199c9,3.6,13.8,13.199,16.2,22.8c0.6,1.2,2.399,1.2,3,0c1.8-12.601,10.799-23.399,22.799-25.8 c24-4.2,44.4,13.199,47.4,36c2.399,19.199-4.199,37.199-13.799,54c-18.602,33.6-37.801,64.8-58.2,96.6 C714.005,643.728,692.405,610.728,675.605,575.327z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryDrawing Brush="#FF0000" Geometry="M801.395,1432.672c2.533,5.338,6.6,13.199,7.801,18.6c3.6,13.8,7.199,30,3,44.4 c-6.6,22.799-34.801,31.199-55.801,22.199c-9-3.6-13.799-13.199-16.199-22.8c-0.6-1.2-2.4-1.2-3,0 c-1.8,12.601-10.799,23.399-22.799,25.8c-24,4.2-44.4-13.199-47.4-36c-2.4-19.199,4.199-37.199,13.799-54 c18.602-33.6,37.801-64.799,58.2-96.6C762.994,1364.271,784.596,1397.271,801.395,1432.672z" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DrawingGroup.Children&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/DrawingGroup&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a size=1&gt;&amp;nbsp; &amp;lt;/DrawingBrush.Drawing&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a size=1&gt;&amp;nbsp;&amp;lt;/DrawingBrush&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In case you're wondering, I didn't create that XAML by hand! :)&amp;nbsp; I started with &lt;A href="http://www.adobe.com/products/illustrator/main.html"&gt;Adobe Illustrator&lt;/A&gt;, saved the file as SVG, then dealt with it from there.&lt;/P&gt;
&lt;P&gt;The button style also contains an event trigger for Mouse.MouseEnter and another for Mouse.MouseLeave. Each of these points to a "storyboard" that handles the card animations (such as scaling and rotating).&amp;nbsp; The only piece of code I needed to write was the property that sets the face:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&amp;nbsp;// The user (via code or XAML) can simply specify the&lt;BR&gt;&amp;nbsp;// name of the face, which must match the name of one of the&lt;BR&gt;&amp;nbsp;// DrawingBrushes in Card.xaml.&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; Face&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;{&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; &amp;nbsp;get&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; face.ToString(); }&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&amp;nbsp; &amp;nbsp;set&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; &lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; &amp;nbsp;{&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; // Let exception happen on bad input. The system handles it well.&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; face = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; CardButton.Background = (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008080 size=2&gt;Brush&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;)Resources[face];&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp; &amp;nbsp;} &lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;}&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;private&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;string&lt;/FONT&gt; face;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;For now, the Hand control in Hand.xaml just hardcodes a set of cards in specific positions and rotations on a Canvas (again wrapped in a Viewbox for uniform scaling). For example:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;lt;&lt;STRONG&gt;c:Card&lt;/STRONG&gt; Width="100" Canvas.Left="10" &lt;STRONG&gt;Face="C7"&lt;/STRONG&gt;&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp; &amp;lt;c:Card.RenderTransform&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;nbsp; &amp;lt;RotateTransform Center="50,140" Angle="310" /&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp; &amp;lt;/c:Card.RenderTransform&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a52a2a&gt;&amp;nbsp;&amp;lt;&lt;STRONG&gt;/c:Card&lt;/STRONG&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Enjoy, and don't hesitate to give me feedback!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=414148" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item><item><title>Migrating Internet Hearts to WinFX</title><link>http://blogs.msdn.com/adam_nathan/archive/2005/05/02/414174.aspx</link><pubDate>Tue, 03 May 2005 09:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:414174</guid><dc:creator>Adam Nathan</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/adam_nathan/comments/414174.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adam_nathan/commentrss.aspx?PostID=414174</wfw:commentRss><wfw:comment>http://blogs.msdn.com/adam_nathan/rsscomments.aspx?PostID=414174</wfw:comment><description>&lt;P&gt;Last year, &lt;A href="http://sellsbrothers.com/"&gt;Chris Sells&lt;/A&gt; wrote &lt;A href="http://msdn.microsoft.com/longhorn/understanding/columns/default.aspx?pull=/library/en-us/dnfoghorn/html/foghorn02112004.asp"&gt;a series of articles&lt;/A&gt; in which he set out to rewrite Solitaire using Avalon.&amp;nbsp; The lack of scaling graphics in the Win32 version (and lack of access to&amp;nbsp;its source code, I suppose) forced him down the road of rewriting the app from scratch.&amp;nbsp; Plus, the point was to explore "the initial decisions developers will make when building new applications targeting Longhorn."&amp;nbsp; (This was before &lt;a href="http://blogs.msdn.com/brada/archive/2004/08/29/222489.aspx"&gt;WinFX got decoupled from Longhorn&lt;/A&gt; and made available for Windows XP &amp;amp; Windows Server 2003.)&lt;/P&gt;
&lt;P&gt;This year, I'm going to create a new WinFX-enabled version of Internet Hearts (the not-as-popular card game that also ships with Windows XP).&amp;nbsp; But the focus is going to be on &lt;EM&gt;migration&lt;/EM&gt;&amp;nbsp;rather than starting from scratch.&amp;nbsp; I'll&amp;nbsp;gradually replace the UI with Avalon and the communication with Indigo.&amp;nbsp; After all, I want to focus on the cool stuff; not rewriting the basic logic.&amp;nbsp; I'll share results as I go along, and hopefully I'll be able to share the source code, pre-migration and post-migration!&lt;/P&gt;
&lt;P&gt;I want to give special thanks to Steven Goulet (one of the folks on my new team), who came up with Internet Hearts as a great example application that could benefit from Avalon &amp;amp; Indigo.&amp;nbsp; He also did the legwork of getting permission&amp;nbsp;for the original source code.&amp;nbsp; So without him, this would not be possible!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=414174" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Managed+Code/default.aspx">Managed Code</category><category domain="http://blogs.msdn.com/adam_nathan/archive/tags/Hearts/default.aspx">Hearts</category></item></channel></rss>