<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://cromwellhaus.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/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Cromwell Haus</title><link>http://cromwellhaus.com/blogs/</link><description>A place for the Cromwell family to gather, share pictures, &lt;br /&gt; and discuss anything under the sun.</description><dc:language>en-US</dc:language><generator>CommunityServer 2008 (Build: 30417.1769)</generator><item><title>The WPF Mindset</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/11/03/the-wpf-mindset.aspx</link><pubDate>Mon, 03 Nov 2008 15:38:00 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:765</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;WPF is awesome, but it requires the developer to make a pretty big shift in their thinking of UI.&amp;#160; I’ve had a hard time explaining this to people, but last week, I had an opportunity to work through an example with &lt;a href="http://blogger.forgottenskies.com/"&gt;Steve Gentile&lt;/a&gt;.&amp;#160; That’s the basis of this walkthrough.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;The Scenerio&lt;/h2&gt;  &lt;p&gt;Steve has an ASP.Net website he maintains called &lt;a href="http://www.forgottenskies.com/"&gt;ForgottenSkies.com&lt;/a&gt;.&amp;#160; One of the pages displays a map from the game with events that were captured from the server.&amp;#160; You can see the ASP.Net version &lt;a href="http://www.forgottenskies.com/ForgottenWars/FSWarMap.aspx"&gt;here&lt;/a&gt;.&amp;#160; Steve was looking to create a Silverlight version of this page.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Wrong Mindset&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The initial response from most developers would be to put an image on the “form” and then figure out a way to place some composite control or other image that would denote each event’s location.&amp;#160; If they had the inclination they might use the DataContext, but they likely would also iterate each Event in some collection and manually place these controls within some container.&amp;#160; I believe Steve was trying to place them into a really big grid with lots of Rows and Columns to represent the Latitude and Longitude of the map.&lt;/p&gt;  &lt;h2&gt;The WPF Mindset&lt;/h2&gt;  &lt;p&gt;Decomposing this scenario is vital to using WPF properly.&amp;#160; When it comes down to it, the map is really just a way to visualize a collection of Events. If we wanted we could easily make this a list, couldn’t we?&amp;#160; So lets start there:&lt;/p&gt;  &lt;p&gt;For the purposes of this demo, the Window.DataContext is set to an instance of an AttackService, which looks like the following:&lt;/p&gt;  &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:650px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; AttackService
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ObservableCollection&amp;lt;Attack&amp;gt; Attacks { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; MapSize { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; AttackService()
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.MapSize = 160;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Attacks = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ObservableCollection&amp;lt;Attack&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        Random random = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Random();
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; index =0; index &amp;lt; 10;index++)
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            var attack = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Attack
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                Description = &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&amp;quot;&lt;span style="color:#8b0000;"&gt;Attack {0}&lt;/span&gt;&amp;quot;, index),
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                Latitude = random.Next(0, MapSize),
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                Longitude = random.Next(0, MapSize),
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                Type = (AttackType)random.Next(0, 2)
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            };
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Attacks.Add(attack);
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Our goal is to display the Attacks collection, so let’s do that:&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:650px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Class&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;WpfApplication1.Window1&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;        
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ListView&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ItemsSource&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Attacks}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_357ED79C.png"&gt;&lt;img style="display:inline;margin-left:0px;margin-right:0px;" title="image" border="0" alt="image" align="left" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_4616D28A.png" width="160" height="171" /&gt;&lt;/a&gt;We have a ListView which has it’s ItemsSource bound to our Attacks collection.&amp;#160; Nothing special.&amp;#160; WPF doesn’t know how to display an Attack class so if we would just see a 10 instances of our class name listed.&amp;#160; We’ll get there though.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For starters, lets look at these as if they were listed in a table (or GridView). To do this, we’ll tell the ListView to use a style, &lt;em&gt;attacksList&lt;/em&gt;.&amp;#160; We’ll place this style definition in our Window’s Resources collection for convenience of our demo. &lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:650px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Class&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;WpfApplication1.Window1&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;        
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Key&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;attacksList&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetType&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ListView&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;View&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;GridView&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Description}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Latitude&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Latitude}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Longitude&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Longitude}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;GridView&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;        
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;        
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ListView&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;attacksList&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ItemsSource&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Attacks}&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Style&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{StaticResource attacksList}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;What we’ve done is given ourselves a way to set values or properties on the ListView.&amp;#160; &lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image6_5F00_7253596E.png"&gt;&lt;img style="display:inline;margin-left:0px;margin-right:0px;" title="image" border="0" alt="image" align="right" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image6_5F00_thumb_5F00_74ACDB6C.png" width="149" height="183" /&gt;&lt;/a&gt;For the sample you see here, we set the type of View for the ListView to be a GridView.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;The Map&lt;/h2&gt;

&lt;p&gt;The ultimate visualization of this information is to display it contextually in a map.&amp;#160; It’s important to remember that this is still a list, we just want to visualize the list differently.&amp;#160; To do this we need to change our &lt;em&gt;attacksListStyle&lt;/em&gt;.&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:674px;padding-right:5px;height:454px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Key&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;attacksList&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetType&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ListView&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ItemsPanel&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Canvas&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Canvas.Background&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ImageBrush&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ImageSource&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Images\Map.jpg&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Canvas.Background&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Canvas&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ItemContainerStyle&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{StaticResource attackContainerStyle}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Instead of setting the View of our ListView, we are now setting the ItemsPanel to a Canvas.&amp;#160; This tells the ListView to place all of the items its charged with listing into the Canvas.&amp;#160; We have chosen canvas, because we will want to place each item via coordinates (X/Y, Left/Type) rather than stacking, row/column, etc.&amp;#160; The background of our Canvas is going to be a JPG version of our map.&amp;#160; Backgrounds and Foregrounds are always brushes, so we are using an ImageBrush to draw our map on the Canvas background.&lt;/p&gt;

&lt;p&gt;The second property we are setting is the &lt;em&gt;ItemContainerStyle &lt;/em&gt;to the &lt;em&gt;attackContainerStyle&lt;/em&gt;.&amp;#160; The ListView places each item into a container rather than displaying it directly.&amp;#160; In order to place it correctly, we need to set the Top and Left properties of this ItemContainer.&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:650px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Key&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;attackContainerStyle&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Canvas.Top&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Latitude}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Canvas.Left&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding Longitude}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This binds the Canvas.Top and Canvas.Left &lt;a href="http://msdn.microsoft.com/en-us/library/ms752914.aspx"&gt;DependencyProperties&lt;/a&gt; to the Attack.Latitude and Attack.Longitude properties respectively.&amp;#160; To bring this together, we have our ListView bound to a collection of Attacks and the ItemContainer contains each Attack and has its DataContext set to that Attack it is meant to contain.&lt;/p&gt;

&lt;p&gt;At this point we have most of what we want.&amp;#160; &lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_33322913.png"&gt;&lt;img style="display:inline;" title="image" border="0" alt="image" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_4BA17AC9.png" width="310" height="214" /&gt;&lt;/a&gt;Each little black image you see below represents an attack.&amp;#160; This is done by setting the DataTemplate for the Attack type.&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:379px;padding-right:5px;height:105px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataType&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{x:Type local:Attack}&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Image&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Source&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Images\AlliedTerritory.gif&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The problem you will find is that if you allow the Window to be scaled beyond the size of the map size as it existed when creating the Attack Latitude and Longitude, the points on the map will not scale or move with the map.&amp;#160; I dealt with this by implementing an &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.data.imultivalueconverter.aspx"&gt;IMultiValueConverter&lt;/a&gt;.&amp;#160; I won’t go into it here as it doesn’t pertain to our Mindset discussion, but I’ve included it in the attacked source code.&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;If you come into WPF trying to create cool graphics or visualizations from the outset, you will miss the power and productivity of the platform.&amp;#160; WPF and the oft-sited Designer/Developer scenario actually thrive when you begin to simplify your application into the basics and then apply visualizations.&lt;/p&gt;

&lt;p&gt;Get the source for this project here:&amp;#160; &lt;a href="http://cromwellhaus.com/samples/mapaslistview.zip"&gt;Source Code&lt;/a&gt;.&amp;#160; The Xaml for this is literally only 67 lines with spaces.&amp;#160; There is 1 line of custom code in code behind, and you saw the AttackService above.&amp;#160; It’s dead simple.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=765" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Why VMWare over Virtual PC</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/10/21/why-vmware-over-virtual-pc.aspx</link><pubDate>Tue, 21 Oct 2008 16:41:17 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:761</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I just found the reason why I’m going to slap down almost $200 bucks for VMWare Workstation over Virtual PC: Unity.&amp;#160; I am using a coworkers VM to help on a project he’s been working on, but he uses VMWare and I use Virtual PC.&amp;#160; Instead of buy a license I’m using &lt;a href="http://www.vmware.com/products/player/"&gt;VMWare Player&lt;/a&gt;.&amp;#160; Well I found option under VMWare called Unity so of course I clicked it.&amp;#160;&amp;#160; Well it’s possibly the coolest thing I’ve seen ever.&amp;#160; &lt;/p&gt;  &lt;p&gt;Here is my desktop with VMWare running as normal:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_1A338E68.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="VMWare Normal" border="0" alt="VMWare Normal" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_6B212CC3.png" width="640" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;and here it is with Unity:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_67BF951B.png"&gt;&lt;img style="display:inline;" title="image" border="0" alt="image" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_14389F35.png" width="640" height="404" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;All of the windows/applications that were active inside the VM are now native windows in my host.&amp;#160; Also, when you go down to the start button, a second Start Button with the name of the VM becomes visible that allows you to start other apps in this same mode.&amp;#160; I don’t care what you say, that’s just awesome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=761" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Software+Reviews/default.aspx">Software Reviews</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/VMWare/default.aspx">VMWare</category></item><item><title>Gates/Seinfeld Commercial</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/09/05/gates-seinfeld-commercial.aspx</link><pubDate>Fri, 05 Sep 2008 13:39:16 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:743</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;So everyone is hating on the new Gates/Seinfeld commercial (you can see it on &lt;a target="_blank" href="http://www.microsoft.com/windows/default.aspx?icid=winvan"&gt;Windows.com&lt;/a&gt;).&amp;nbsp; Maybe I like Seinfeld humor too much, but I think it&amp;#39;s hilarious.&amp;nbsp; It doesn&amp;#39;t inundate me with Windows or Vista glare, it&amp;#39;s not over the top, it&amp;#39;s just funny.&amp;nbsp; I mean, Bill Gates just wiggled his rear end on &lt;em&gt;national television!&lt;/em&gt;&lt;/p&gt; &lt;p&gt;I guess I&amp;#39;m just easy to please.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=743" width="1" height="1"&gt;</description></item><item><title>TFS Screencasts - Part 2 - Scrum For Team System Features</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/09/04/tfs-screencasts-part-2-scrum-for-team-system-features.aspx</link><pubDate>Thu, 04 Sep 2008 18:44:05 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:742</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;One of the things we are using here at &lt;a target="_blank" href="http://www.sds-consulting.com/"&gt;SDS&lt;/a&gt; for our TFS installation and projects is the &lt;a target="_blank" href="http://www.scrumforteamsystem.com/"&gt;Scrum for Team System&lt;/a&gt; which provides a new Sharepoint Portal layout, Reporting Services reports and graphs, Work Item Templates, and an awesome &lt;a target="_blank" href="http://www.scrumforteamsystem.com/processguidance/v2/Process/Process.aspx"&gt;Process Guidance reference&lt;/a&gt;.&amp;nbsp; &lt;/p&gt; &lt;p&gt;In this screencast, I try to point out some of these features and how to get to them.&amp;nbsp; It&amp;#39;s short (just over 2 minutes) and I&amp;#39;ll dive into each as we continue our storyline.&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;" id="scid:{7D7E1B1B-BB15-44b5-AC22-DF49F6B00FD3}:c69597b0-566d-4041-afd3-ee3b41f02b98" class="wlWriterSmartContent"&gt;   &lt;iframe src="http://silverlight.services.live.com/invoke/77629/SDS%20TFS%20-%20Part%202%20-%20Scrum%20Template%20Features/iframe.html" scrolling="no" frameborder="0" style="width:320px;height:240px;"&gt;&lt;/iframe&gt; &lt;/div&gt;&lt;/p&gt; &lt;p&gt;Shoutout to Camtasia which is sooo simple to use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=742" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/TFS/default.aspx">TFS</category></item><item><title>TFS Screencasts - Part 1 - Create a Team Project</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/08/27/tfs-screencasts-part-1-create-a-team-project.aspx</link><pubDate>Wed, 27 Aug 2008 22:54:00 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:738</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;One of the projects I&amp;#39;m working on for my company, &lt;a target="_blank" href="http://www.sds-consulting.com/"&gt;Strategic Data Systems&lt;/a&gt;, is our internal Team Foundation Server 2008 solution.&amp;nbsp; I&amp;#39;m working with some of the guys who head up our Agile Development Center to make sure things fit well with what they are doing.&amp;nbsp; It&amp;#39;s been difficult to find overlapping free time, so I have started putting together screencasts to highlight our procedures and what I consider best-practices.&amp;nbsp; We&amp;#39;ve published written documentation internally, but these are so much more palatable.&lt;/p&gt; &lt;p&gt;These are geared toward our organization in content, but should be generally relevant to anyone interested in TFS.&amp;nbsp; This particular screencast walks through creating a Team Project and specifying permissions for implementing Scrum roles.&lt;/p&gt; &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;" id="scid:{7D7E1B1B-BB15-44b5-AC22-DF49F6B00FD3}:7057f11d-5025-4496-98a7-3de06b928709" class="wlWriterSmartContent"&gt;   &lt;iframe src="http://silverlight.services.live.com/invoke/77629/SDS%20Team%20Foundation%20Server%20-%20Part%201%20-%20Create%20a%20Team%20Project/iframe.html" scrolling="no" frameborder="0" style="width:320px;height:240px;"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;a target="_blank" href="http://silverlight.services.live.com/77629/SDS%20Team%20Foundation%20Server%20-%20Part%201%20-%20Create%20a%20Team%20Project/video.wmv"&gt;Direct Link&lt;/a&gt;&lt;/p&gt; &lt;p&gt;p.s This is hosted, for free (as in beer), by &lt;a target="_blank" href="http://silverlight.live.com/"&gt;Silverlight Streaming Services&lt;/a&gt;.&amp;nbsp; It took all of 20 seconds to sign up and 5 minutes to upload the video made with &lt;a target="_blank" href="http://www.camtasia.com/camtasia.asp"&gt;Camtasia&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=738" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/TFS/default.aspx">TFS</category></item><item><title>Outlook 2007 does the little things</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/08/26/outlook-2007-does-the-little-things.aspx</link><pubDate>Tue, 26 Aug 2008 20:23:40 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:735</guid><dc:creator>cromwellryan</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;People give Microsoft Outlook a lot of crap, but if you&amp;#39;re willing to think outside the box, you&amp;#39;ll realize they did all the little things that make life easy.&amp;nbsp; For instance, I rarely use the calendar popup for creating new appointments.&amp;nbsp; No, if I have a meeting next Wednesday, I type &amp;quot;&lt;em&gt;next wed&amp;quot;&lt;/em&gt; and hit tab.&amp;nbsp; It&amp;#39;s at 1pm, well, type 1 and hit tab.&lt;/p&gt; &lt;p&gt;Done.&lt;/p&gt; &lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_2.png"&gt;&lt;img height="413" alt="New Appt. Screenshot" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb.png" width="640" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=735" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Software+Reviews/default.aspx">Software Reviews</category></item><item><title>SQL Server 2000 vs 2005 Lazy XML Validation</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/08/19/sql-server-2000-vs-2005-lazy-xml-validation.aspx</link><pubDate>Tue, 19 Aug 2008 16:55:39 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:730</guid><dc:creator>cromwellryan</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Someone was looking to do quick-and-dirty validation of an Xml document inside a SQL Server procedure today.&amp;nbsp; I assumed, and regretted, that he meant 2005, which would have looked like this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;declare @xml1 xml&amp;nbsp; &lt;br /&gt;declare @xml2 xml&amp;nbsp; &lt;br /&gt;set @xml1 = &amp;#39;&amp;lt;Node1&amp;gt;&amp;lt;Node2 attrib=&amp;quot;This is it.&amp;quot; /&amp;gt;&amp;lt;/Node1&amp;gt;&amp;#39;&lt;br /&gt;set @xml2 = &amp;#39;&amp;lt;Node1&amp;gt;&amp;lt;Node2 /&amp;gt;&amp;lt;/Node1&amp;gt;&amp;#39;&lt;br /&gt;select Col.value(&amp;#39;count(./@attrib)&amp;#39;, &amp;#39;int&amp;#39;) as count&lt;br /&gt;from @xml1.nodes(&amp;#39;Node1/Node2&amp;#39;) as Tbl(Col)  &lt;p&gt;select Col.value(&amp;#39;count(./@attrib)&amp;#39;, &amp;#39;int&amp;#39;) as count&lt;br /&gt;from @xml2.nodes(&amp;#39;Node1/Node2&amp;#39;) as Tbl(Col)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;After being told, &amp;quot;that blows up&amp;quot;, I jogged the memory a bit and came up with this mess:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;/* THE STUPID WAY */&lt;br /&gt;DECLARE @hdoc int&lt;br /&gt;DECLARE @doc1 varchar(MAX)&lt;br /&gt;DECLARE @doc2 varchar(MAX)&lt;br /&gt;set @doc1 = &amp;#39;&amp;lt;Node1&amp;gt;&amp;lt;Node2 attrib=&amp;quot;This is it.&amp;quot; /&amp;gt;&amp;lt;/Node1&amp;gt;&amp;#39;&lt;br /&gt;set @doc2 = &amp;#39;&amp;lt;Node1&amp;gt;&amp;lt;Node2 /&amp;gt;&amp;lt;/Node1&amp;gt;&amp;#39;&lt;br /&gt;/* DOC 1 */&lt;br /&gt;EXEC sp_xml_preparedocument @hdoc OUTPUT, @doc1  &lt;p&gt;IF EXISTS( SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPENXML (@hdoc, &amp;#39;/Node1/Node2/@attrib&amp;#39;,1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH (attrib&amp;nbsp; varchar(20)))&lt;br /&gt;BEGIN&lt;br /&gt;PRINT &amp;#39;Dumb ass&amp;#39;&lt;br /&gt;END&lt;br /&gt;exec sp_xml_removedocument @hdoc  &lt;p&gt;/* DOC 2 */&lt;br /&gt;EXEC sp_xml_preparedocument @hdoc OUTPUT, @doc2  &lt;p&gt;IF EXISTS( SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPENXML (@hdoc, &amp;#39;/Node1/Node2/@attrib&amp;#39;,1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH (attrib&amp;nbsp; varchar(20)))&lt;br /&gt;BEGIN&lt;br /&gt;PRINT &amp;#39;Dumb ass&amp;#39;&lt;br /&gt;END&lt;br /&gt;exec sp_xml_removedocument @hdoc &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Moral of the store?&amp;nbsp; UPGRADE!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=730" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>Installation Guides</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/08/06/installation-guides.aspx</link><pubDate>Wed, 06 Aug 2008 03:25:31 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:717</guid><dc:creator>cromwellryan</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;This evening I completed my first split-server (or dual server as it&amp;#39;s called in the guide) installation of Team Foundation Server 2008.&amp;nbsp; I&amp;#39;ve installed TFS a few times now in single-server mode which is pretty crazy easy when you consider what you get (way more than SVN or CVS by themselves).&amp;nbsp; Throughout the entire process I actually found myself RTFM step -by-step.&amp;nbsp; For all the grief that Microsoft receives, you have to give them a ton of credit for their manuals, guides, and walk-throughs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=717" width="1" height="1"&gt;</description></item><item><title>Reason #29 for using Virtual Machines</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/08/06/reason-29-for-using-virtual-machines.aspx</link><pubDate>Wed, 06 Aug 2008 02:47:14 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:715</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Today I blew up a server.&amp;nbsp; Couldn&amp;#39;t figure something out so I pushed every button I could find, flipped every switch and changed every setting.&amp;nbsp; Nothing.&amp;nbsp; So you know what I did, I deleted it, copied over a new &lt;a href="http://cromwellhaus.com/blogs/ryanc/archive/2008/06/13/sysprep-your-virtual-pc-images.aspx" target="_blank"&gt;Sysprepped Hard Drive&lt;/a&gt; and had a clean slate in about 5 minutes.&lt;/p&gt; &lt;p&gt;I figured out my problem, by the way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=715" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category></item><item><title>Why Plain Old LINQ is so powerful</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/31/why-plain-old-linq-is-so-powerful.aspx</link><pubDate>Thu, 31 Jul 2008 19:04:20 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:711</guid><dc:creator>cromwellryan</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;a href="http://www.interact-sw.co.uk/iangblog/" target="_blank"&gt;Ian Griffiths&lt;/a&gt; posted a &lt;a href="http://www.interact-sw.co.uk/iangblog/2008/07/30/linq-box-aggregation" target="_blank"&gt;great example&lt;/a&gt; of how powerful and cool LINQ is when used in everyday code (it&amp;#39;s not all about databases people).&lt;/p&gt; &lt;p&gt;If you haven&amp;#39;t started to learn how to incorporate this awesome toolset into your daily coding life, you&amp;#39;re killing yourself.&amp;nbsp; No excuses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=711" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category></item><item><title>Roadblock to Mocking Unit Tests</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/15/roadblock-to-mocking-unit-tests.aspx</link><pubDate>Tue, 15 Jul 2008 13:58:51 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:692</guid><dc:creator>cromwellryan</dc:creator><slash:comments>14</slash:comments><description>&lt;p&gt;I&amp;#39;ve been a faithful unit tester for a few years now.&amp;nbsp; I may not do everything by the book (I think end-to-end unit tests are helpful), but I do get good coverage most of the time.&amp;nbsp; That said, I&amp;#39;ve found myself unable to use any of the Mock frameworks out there, because I don&amp;#39;t use your typical Dependency Injection pattern.&amp;nbsp; That is, I don&amp;#39;t like &amp;quot;building up&amp;quot; very freaking instance with all the &amp;quot;Provider&amp;quot; or &amp;quot;Service&amp;quot; interfaces I&amp;#39;m might need in the possible life of a business object.&amp;nbsp; Yes, if your Customer class is only going to create or save an Order, it feels OK, but my objects are busy dude, so I&amp;#39;d need the longest constructor of all time.&lt;/p&gt; &lt;p&gt;I prefer &lt;a href="http://search.live.com/results.aspx?q=dependency+resolution+mock&amp;amp;form=QBRE" target="_blank"&gt;Dependency Resolution&lt;/a&gt;.&amp;nbsp; I don&amp;#39;t use any fancy framework, I just use a good old, DI.Resolve&amp;lt;IBusyBee&amp;gt;() and go about my business.&amp;nbsp; It works wonderfully, it&amp;#39;s light-weight (cause I don&amp;#39;t use configuration based DI frameworks), and it&amp;#39;s my baby.&lt;/p&gt; &lt;p&gt;That said, it&amp;#39;s also been the roadblock to my mocking foray.&amp;nbsp; That was, until I &amp;quot;got it&amp;quot; today.&amp;nbsp; Long story short, here&amp;#39;s how I roll:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Create a Mock DI Container...&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;IDIContainer&lt;/span&gt;&amp;gt; mockContainer = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;IDIContainer&lt;/span&gt;&amp;gt;();&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Create the Injected Mock instances...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;INotificationManager&lt;/span&gt;&amp;gt; mockNotifMgr = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;INotificationManager&lt;/span&gt;&amp;gt;();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;IRepository&lt;/span&gt;&amp;gt; mockRepository = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;IRepository&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tell the mock IDIContainer to return the mock instances when asked...&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt;mockContainer.Expect(c =&amp;gt; c.Resolve&amp;lt;&lt;span style="color:#2b91af;"&gt;INotificationManager&lt;/span&gt;&amp;gt;(&lt;span style="color:blue;"&gt;null&lt;/span&gt;)).Returns(mockNotifMgr.Object);
mockContainer.Expect(c =&amp;gt; c.Resolve&amp;lt;&lt;span style="color:#2b91af;"&gt;IRepository&lt;/span&gt;&amp;gt;(&lt;span style="color:blue;"&gt;null&lt;/span&gt;)).Returns(mockRepository.Object);
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Mock your heart out...&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt;mockNotifMgr.Expect(mgr =&amp;gt; mgr.NotifyEmailConfirmation(&lt;span style="color:#2b91af;"&gt;It&lt;/span&gt;.IsAny&amp;lt;&lt;span style="color:#2b91af;"&gt;Member&lt;/span&gt;&amp;gt;())).AtMostOnce();
&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color:#2b91af;"&gt;Member&lt;/span&gt;.Register(&lt;span style="color:#a31515;"&gt;&amp;quot;username&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;firstname&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;lastname&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;ryan@myus.com&amp;quot;&lt;/span&gt;);

mockContainer.VerifyAll();
mockNotifMgr.VerifyAll();
&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;I&amp;#39;m very happy to have finally jumped on the Moq bandwagon as it will certainly make some unit tests much easier to write.&amp;nbsp; Maybe I&amp;#39;ll even do the test first part more faithfully now.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;FYI, I use my own DI framework which is just a glorified HashTable.&amp;nbsp; It works for me and it is quick.&amp;nbsp; &lt;a href="http://moq.googlecode.com/" target="_blank"&gt;Moq&lt;/a&gt; has also become my Mock framework of choice for no good reason other than I downloaded it first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=692" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category></item><item><title>Video Conferencing Code of Conduct</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/07/video-conferencing-code-of-conduct.aspx</link><pubDate>Mon, 07 Jul 2008 19:01:18 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:690</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;My team uses &lt;a href="http://www.oovoo.com/"&gt;ooVoo&lt;/a&gt; for video conferencing our Daily Scrum.&amp;nbsp; It&amp;#39;s been great and very reliable.&amp;nbsp; My only complaint is a lack of whiteboard or desktop sharing, but we&amp;#39;ve overcome these obstacles with other tools (see &lt;a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=94&amp;amp;wa=wsignin1.0"&gt;SharedView&lt;/a&gt;).&amp;nbsp; Over the months, I&amp;#39;ve come to acquire an expectation of what the experience should be like and, from that, a Code of Conduct.&amp;nbsp; Here it is:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Don&amp;#39;t Be a Slob&lt;/strong&gt; - Just cause you&amp;#39;re in your bedroom or PJ&amp;#39;s doesn&amp;#39;t mean I want to know about it.&amp;nbsp; Put a decent shirt on and brush your hair.&amp;nbsp; Same goes for yawning, coughing, and every other table manner.&amp;nbsp; Cover your mouth, mute the Mic, whatever.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Have a Headset&lt;/strong&gt; - I&amp;#39;m sure some guy out there is ecstatic about the next step in the evolution of the speaker phone, but they still suck in comparison to a headset and Mic that are placed against their corresponding body part.&amp;nbsp; You&amp;#39;re laptop&amp;#39;s built in speaker and Mic are no better, so fork out the 10 bucks and get a cheap headset you cheap-***.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Go Full or Go Home&lt;/strong&gt; - I&amp;#39;m glad your torrents are racing, but your video looks like the corner of your head just entered the Atari zone.&amp;nbsp; Stop downloading the latest SUSE iso for a few minutes and give me your full bandwidth attention.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=690" width="1" height="1"&gt;</description></item><item><title>Setting up a Virtual PC Domain</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/07/setting-up-a-virtual-pc-domain.aspx</link><pubDate>Mon, 07 Jul 2008 18:38:30 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:688</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I do a lot of demos and Virtual PC 2007 is a mainstay in my arsenal for those demos.&amp;nbsp; I&amp;#39;ve used VMWare Server (the free one) and it is very nice, but I run an x64 OS and VMWare had neglected to sign certain emulation drives which caused me enough headache that I ditched it for the easy of VPC.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I mentioned using &lt;a href="http://cromwellhaus.com/blogs/ryanc/archive/2008/06/13/sysprep-your-virtual-pc-images.aspx"&gt;Syspreping&lt;/a&gt; for my VPC library prior which saves me a ton of time, but one of the things I&amp;#39;ve always started but never finished was setting up a Virtual Domain.&amp;nbsp; Well this weekend, I finished things up and I&amp;#39;m happy to say, it wasn&amp;#39;t that bad.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Here&amp;#39;s what I did:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Create My Domain Controller Machine&lt;/strong&gt; by copying a Syspreped Window 2008 Server harddrive image and creating a new Virtual PC using an existing hard drive.&amp;nbsp; About 120 seconds later I have a free standing vanilla server ready to roll.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_8.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="174" alt="image" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_3.png" width="240" align="right" border="0" /&gt;&lt;/a&gt;Configure Network Adapter(s) &lt;/strong&gt;by specifying &lt;em&gt;Local Only&lt;/em&gt; in the VPC&amp;#39;s Network Settings.&amp;nbsp; &lt;/p&gt; &lt;p&gt;At this point you&amp;#39;ll want to log into VPC if you haven&amp;#39;t already.&amp;nbsp; We&amp;#39;ll want to isolate our domain and let each of the workstation VPC&amp;#39;s communicate with the domain controller by going into the Network Adapter&amp;#39;s properties.&amp;nbsp; Our little domain network is going to be rather isolated.&amp;nbsp; To accomplish this, we will specify a specific Subnet and IP address range.&amp;nbsp; Here is what I&amp;#39;ve used for mine:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;IP Range: 192.168.8.1 - 254 (where 192.168.8.1 is my domain controller IP)&lt;br /&gt;Subnet Mask: 255.255.248.0&lt;br /&gt;Gateway: 192.168.8.1 (DC/DNS server)&lt;br /&gt;Primary DNS: 192.168.8.1 (DC/DNS server)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_4.png"&gt;&lt;strong&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="205" alt="image" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_1.png" width="244" align="right" border="0" /&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; Setting up Active Directory&lt;/strong&gt; is a breeze if you do it the easy way.&amp;nbsp; Of course, I did it the easy way the last time.&amp;nbsp; (Note to self: when just learning, take the defaults).&amp;nbsp; Windows Server 2003 and 2008 have this concept of Roles.&amp;nbsp; A server can fill one or more roles which are the conglomeration of settings, services, etc to do something more abstract... like be a DC.&amp;nbsp; We are going to add the role &lt;em&gt;Active Directory Domain Services&lt;/em&gt;.&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;After the Add Role wizard does it&amp;#39;s thing, you actually &amp;quot;promote&amp;quot; the machine to a DC by running dcpromo.exe (Start, dcpromo, Enter).&amp;nbsp; This is where you make your selections, which in this case, I&amp;#39;ve chosen:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Create a new domain in a new forest&lt;br /&gt;FQDN: vpc.com&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;You&amp;#39;ll want to let the machine also be a DNS server.&amp;nbsp; This is where I screwed up the first time.&amp;nbsp; Don&amp;#39;t get scared here, with our networking settings this domain we&amp;#39;re setting up won&amp;#39;t touch your corporate domain or anything crazy like that.&lt;/p&gt; &lt;p&gt;Let the Wizard do it&amp;#39;s thing and reboot when it is complete.&lt;/p&gt; &lt;p&gt;Your Active Directory Domain Controller is ready to roll.&amp;nbsp; Great job. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Adding Workstations &lt;/strong&gt;is a matter of adding a Computer entry into the &lt;em&gt;Active Directory Users and Computers&lt;/em&gt; console and then actually adding the computer to the domain.&amp;nbsp; You&amp;#39;ll find the AD Users and Computers MMC console in Administrative Tools.&amp;nbsp; Once you&amp;#39;ve added a computer entry, log into another VPC instance which has the same Network Adapter settings as above (different IP of course .2, .3, etc) and add the machine to the domain (vpc.com) in my case.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_10.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="244" alt="image" src="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ryanc/image_5F00_thumb_5F00_4.png" width="222" align="right" border="0" /&gt;&lt;/a&gt;Here&amp;#39;s a quick screen capture of my Network Adapter on the Workstation I added to the domain.&lt;/p&gt; &lt;p&gt;It&amp;#39;s great being able to demo Enterprise software this way or test things like integrated authentication for intranet applications. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=688" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Networking/default.aspx">Networking</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category></item><item><title>Did you know?  Screenshots of Virtual PC Instances</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/07/did-you-know-screenshots-of-virtual-pc-instances.aspx</link><pubDate>Mon, 07 Jul 2008 17:31:47 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:687</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you are running a VPC instance and you&amp;#39;d like to take a screenshot of something on the VPC, did you know you can do that without any photo editing hassle?&lt;/p&gt; &lt;p&gt;Simply make sure you aren&amp;#39;t &amp;quot;in&amp;quot; the VPC (hit the right Alt key if you are).&amp;nbsp; Now click and drag a square around the portion of the VM you want to capture.&amp;nbsp; CTRL+C or Edit -&amp;gt; Copy will capture the section to the clipboard and you can paste it wherever.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Nice touch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=687" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category></item><item><title>Why WPF?  This is why...</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/02/why-wpf-this-is-why.aspx</link><pubDate>Wed, 02 Jul 2008 21:08:53 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:686</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a title="http://dnrtv.com/default.aspx?showID=115" href="http://dnrtv.com/default.aspx?showID=115"&gt;http://dnrtv.com/default.aspx?showID=115&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Just awesome!&amp;nbsp; I didn&amp;#39;t see anything far fetched other than they must have a great designer on staff.&amp;nbsp; I wonder if the designer was doing the Blend work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=686" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Visitor Pattern with Anonymous Methods</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/02/visitor-pattern-with-anonymous-methods.aspx</link><pubDate>Wed, 02 Jul 2008 13:35:00 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:685</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I don&amp;#39;t often have the need to implement the &lt;a href="http://www.dofactory.com/Patterns/PatternVisitor.aspx"&gt;Visitor Pattern&lt;/a&gt;, but today I was that day.&amp;nbsp; I looked around really quick for an example of how to do this with &lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx"&gt;Lambda Expressions&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/0yw3tz5k.aspx"&gt;Anonymous Methods&lt;/a&gt;, which seemed like they were the way to go.&amp;nbsp; It may be that my search skills have deteriorated right along with my sense of style, but I didn&amp;#39;t find much.&lt;/p&gt;
&lt;p&gt;I played around for a few minutes and here is what I came up with:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="csharpcode"&gt;
&lt;div class="csharpcode"&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="code"&gt;&lt;span style="color:#0000ff;"&gt;public abstract class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CarBase
&lt;/span&gt;{
    &lt;span style="color:#0000ff;"&gt;public void &lt;/span&gt;Visit(&lt;span style="color:#2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;CarBase&lt;/span&gt;&amp;gt; action)
    {
        &lt;span style="color:#0000ff;"&gt;if &lt;/span&gt;(action != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
            action(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;);
    }
}

&lt;span style="color:#0000ff;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;BigCar &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;CarBase
&lt;/span&gt;{
    &lt;span style="color:#0000ff;"&gt;public void &lt;/span&gt;RunOverLittleCar()
    {
        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Me smash little car!&amp;quot;&lt;/span&gt;);
    }
}

&lt;span style="color:#0000ff;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;LittleCar &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;CarBase
&lt;/span&gt;{
    &lt;span style="color:#0000ff;"&gt;public virtual void &lt;/span&gt;RunAwayFromBigCar()
    {
        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Go Faster!&amp;quot;&lt;/span&gt;);
    }
}

&lt;span style="color:#0000ff;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;EcoCar &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;LittleCar
&lt;/span&gt;{
    &lt;span style="color:#0000ff;"&gt;public override void &lt;/span&gt;RunAwayFromBigCar()
    {
        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Ouch.&amp;quot;&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color:#0000ff;"&gt;class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Program
&lt;/span&gt;{
    &lt;span style="color:#0000ff;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;[] args)
    {
        &lt;span style="color:#2b91af;"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;CarBase&lt;/span&gt;&amp;gt; cars = &lt;span style="color:#0000ff;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;CarBase&lt;/span&gt;&amp;gt;(&lt;span style="color:#0000ff;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CarBase&lt;/span&gt;[] {
                                                                &lt;span style="color:#0000ff;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;BigCar&lt;/span&gt;(), 
                                                                &lt;span style="color:#0000ff;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;LittleCar&lt;/span&gt;(), 
                                                                &lt;span style="color:#0000ff;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;EcoCar&lt;/span&gt;() 
                                                              });
        &lt;span style="color:#0000ff;"&gt;foreach &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;CarBase &lt;/span&gt;car &lt;span style="color:#0000ff;"&gt;in &lt;/span&gt;cars)
        {
            car.Visit(&lt;span style="color:#0000ff;"&gt;delegate&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;CarBase &lt;/span&gt;c)
            {
                &lt;span style="color:#0000ff;"&gt;if &lt;/span&gt;(c &lt;span style="color:#0000ff;"&gt;is &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;BigCar&lt;/span&gt;)
                    ((&lt;span style="color:#2b91af;"&gt;BigCar&lt;/span&gt;)c).RunOverLittleCar();
                &lt;span style="color:#0000ff;"&gt;else if &lt;/span&gt;(c &lt;span style="color:#0000ff;"&gt;is &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;LittleCar&lt;/span&gt;)
                    ((&lt;span style="color:#2b91af;"&gt;LittleCar&lt;/span&gt;)c).RunAwayFromBigCar();
                &lt;span style="color:#0000ff;"&gt;else if &lt;/span&gt;(c &lt;span style="color:#0000ff;"&gt;is &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;EcoCar&lt;/span&gt;)
                    ((&lt;span style="color:#2b91af;"&gt;EcoCar&lt;/span&gt;)c).RunAwayFromBigCar();
            });
        }

        &lt;span style="color:#0000ff;"&gt;if &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Debugger&lt;/span&gt;.IsAttached)
            &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine();
    }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;


&lt;/p&gt;
&lt;p&gt;In many implementations of the visitor pattern there is an adapter or actual Visitor interface and implementation class which is passed into the Visit() method.&amp;nbsp; This is just smooth.&lt;/p&gt;
&lt;p&gt;My visit method above is a little big to look good as a lambda expression, though maybe I just don&amp;#39;t have the eye for it.&amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=685" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category></item><item><title>Virtual Property C# Code Snippet</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/02/virtual-property-c-code-snippet.aspx</link><pubDate>Wed, 02 Jul 2008 03:31:00 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:684</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For those of you who use NHibernate you may find this convenient, if you don&amp;#39;t already have your own.&amp;nbsp; Below is a C# code snippet for creating a public virtual property (code and file are both there).&amp;nbsp; Just put it in your &lt;em&gt;&amp;lt;Visual Studio 2005/2008&amp;gt;\Code Snippets\Visual C#\My Code Snippets&lt;/em&gt; folder and you&amp;#39;re off and running.&amp;nbsp; No restart required.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.06.84/propv.snippet"&gt;File&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml &lt;/span&gt;&lt;span style="color:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;utf-8&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CodeSnippets  &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CodeSnippet &lt;/span&gt;&lt;span style="color:red;"&gt;Format&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Header&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;propv&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;propv&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Description&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Code snippet for an automatically implemented virtual property&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Description&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Author&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Microsoft Corporation&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Author&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Header&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Literal&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;type&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Property type&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Default&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;int&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Default&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Literal&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Literal&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;property&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Property name&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Default&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;MyProperty&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Default&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
                &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Literal&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Code &lt;/span&gt;&lt;span style="color:red;"&gt;Language&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;csharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&amp;lt;![CDATA[&lt;/span&gt;&lt;span style="color:gray;"&gt;public virtual $type$ $property$ { get; set; }$end$&lt;/span&gt;&lt;span style="color:blue;"&gt;]]&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Code&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt; &lt;/pre&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=684" width="1" height="1"&gt;</description><enclosure url="http://cromwellhaus.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.06.84/propv.snippet" length="909" type="application/xml" /><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Backup Your Site</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/01/backup-your-site.aspx</link><pubDate>Tue, 01 Jul 2008 17:25:15 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:682</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;So last night I was restructuring my hosting infrastructure (read: moving folders around) and managed to delete the folder that hosts most of my sites.&amp;nbsp; I got that nasty sinking feeling in the pit of my stomach.&amp;nbsp; I was able to get things back up, but my hosting provider, which is normally pretty responsive and helpful, took FOREVER to respond to my restore request.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Immediately after that I set up a scheduled job on my home machine to pull down a rar of the site each night.&amp;nbsp; It&amp;#39;s hard to get good help these days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=682" width="1" height="1"&gt;</description></item><item><title>Jing</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/07/01/jing.aspx</link><pubDate>Tue, 01 Jul 2008 08:29:00 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:683</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://jing.cromwellhaus.com/2008-07-01_1427.swf"&gt;http://jing.cromwellhaus.com/2008-07-01_1427.swf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=683" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Software+Reviews/default.aspx">Software Reviews</category></item><item><title>NHibernate Thinks Your Enum is Dirty</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/06/30/nhibernate-thinks-your-enum-is-dirty.aspx</link><pubDate>Mon, 30 Jun 2008 17:18:20 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:681</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Get your head out of the gutter.&lt;/p&gt; &lt;p&gt;It&amp;#39;s important to look at your mapping files closely when trying to diagnose unexpected results.&amp;nbsp; One of our developers had recently added two properties to our big honkin&amp;#39; CustomerOrder entity.&amp;nbsp; These both happened to be enumeration values, which are represented by Int values in the database.&amp;nbsp; Of course, NHibernate mapping files (hbm&amp;#39;s) are from the POCO perspective, which means the &amp;lt;property type=&amp;quot;...&amp;quot; /&amp;gt;&amp;nbsp; value should be the Enumeration&amp;#39;s themselves.&amp;nbsp; If you use Int32, though, things will appear to work, but you&amp;#39;re actually causing NHibernate to do an incompatible type comparison during it&amp;#39;s &amp;quot;Dirty&amp;quot; checks.&amp;nbsp; This will cause your lazily, loaded entities to be dirty as soon as you get them.&lt;/p&gt; &lt;p&gt;So, be careful in reviewing your mappings, because it doesn&amp;#39;t take much to screw up something small that has a big impact.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=681" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/NHibernate/default.aspx">NHibernate</category></item><item><title>SysPrep Your Virtual PC Images</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/06/13/sysprep-your-virtual-pc-images.aspx</link><pubDate>Fri, 13 Jun 2008 18:14:55 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:638</guid><dc:creator>cromwellryan</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I create a lot of Virtual PC images, be they for demos, testing, or actual work.&amp;nbsp; If you haven&amp;#39;t started using Virtual PC all the time, start.&amp;nbsp; When you do, start syspreping your machines and you&amp;#39;ll save yourself a ton of time and find Virtual PC that much more useful.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.windowsnetworking.com/articles_tutorials/Creating-Sysprep-Image-Library-Virtual-PC.html"&gt;Here&lt;/a&gt; is a step-by-step guide.&amp;nbsp; Run, do it now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=638" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category></item><item><title>MiniMVC for WPF</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/04/24/minimvc-for-wpf.aspx</link><pubDate>Thu, 24 Apr 2008 03:29:44 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:582</guid><dc:creator>cromwellryan</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Tonight I presented for the &lt;a href="http://daytondevgroup.net/"&gt;Dayton .Net Developers Group&lt;/a&gt; on WPF.&amp;nbsp; Unlike my previous &lt;a href="http://cromwellhaus.com/blogs/ryanc/archive/2007/09/28/lap-around-wpf-codng.aspx"&gt;Lap Around WPF @ CONDG&lt;/a&gt; which was meant as a beginners guide to WPF, this time we were skipping the basics and plunging into a framework I&amp;#39;ve dubbed MiniMVC.&amp;nbsp; &lt;/p&gt; &lt;p&gt;MiniMVC is, primarily, a set of &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.dependencyproperty.aspx"&gt;DependencyProperties&lt;/a&gt; and custom &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.input.icommand.aspx"&gt;ICommand&lt;/a&gt;&amp;#39;s which allow you to specify a Controller for any &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.frameworkelement.aspx"&gt;FrameworkElement&lt;/a&gt; and/or Action in the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms753391.aspx#logical_tree"&gt;logical tree&lt;/a&gt;.&amp;nbsp; Unlike &lt;a href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Dan Crevier&amp;#39;s D-V-VM&lt;/a&gt; pattern or &lt;a href="http://www.codeproject.com/KB/WPF/MVCtoUnitTestinWPF.aspx"&gt;Josh Smith&amp;#39;s MVC pattern&lt;/a&gt; implementations which rely on explicitly defining &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.input.routedcommand.aspx"&gt;RoutedCommand&lt;/a&gt;s for each action, &lt;a href="http://msdn2.microsoft.com/en-us/library/ms752308.aspx"&gt;binding them up manually&lt;/a&gt;, and other unpleasantries (in my humble opinion - these guys still know more than I) with this framework you can use any old class, with any old method, and start executing actions immediately.&amp;nbsp; Here&amp;#39;s an example:&lt;/p&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Class&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PostDemo.Window1&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://cromwellhaus.com/wpf/minimvc&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;demo&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;clr-namespace:PostDemo&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MiniMVC.Controller&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;demo&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window1Controller&lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MiniMVC.Controller&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TextBox &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;txtMessage&amp;quot;&lt;/span&gt;&lt;span style="color:red;"&gt;Text&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Button&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MiniMVC.Action&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ControllerAction &lt;/span&gt;&lt;span style="color:red;"&gt;Trigger&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Click&amp;quot;&lt;/span&gt;&lt;span style="color:red;"&gt;Action&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Echo&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Return&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding&lt;/span&gt;&lt;span style="color:red;"&gt;ElementName&lt;/span&gt;&lt;span style="color:blue;"&gt;=txtResult,&lt;/span&gt;&lt;span style="color:red;"&gt;Path&lt;/span&gt;&lt;span style="color:blue;"&gt;=Text}&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Parameter&lt;/span&gt;&lt;span style="color:red;"&gt;ParameterName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;message&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Value&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding&lt;/span&gt;&lt;span style="color:red;"&gt;ElementName&lt;/span&gt;&lt;span style="color:blue;"&gt;=txtMessage,&lt;/span&gt;&lt;span style="color:red;"&gt;Path&lt;/span&gt;&lt;span style="color:blue;"&gt;=Text}&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ControllerAction&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;mvc&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MiniMVC.Action&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:#a31515;"&gt;Write Something&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Button&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;txtResult&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;Here&amp;#39;s what&amp;#39;s going on: &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;First, we have this class, Window1Controller, which we are attaching to the Window&amp;#39;s MiniMVC.Controller property.&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;Second, we are setting the MiniMVC.Action property on the Button to a ControllerAction triggered by the button&amp;#39;s Click event.&amp;nbsp; When &lt;em&gt;Click&lt;/em&gt; occurs the Action to be taken on the Controller is &lt;em&gt;Echo&lt;/em&gt;.&amp;nbsp; We want to pass into Echo the value of the txtMessage TextBox Text value as parameter &lt;em&gt;message&lt;/em&gt;.&amp;nbsp; Also, we&amp;#39;re specifying that the Return value from Echo should be applied to the Text property of the txtResult TextBox controller.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;Cool?&amp;nbsp; So what&amp;#39;s &lt;em&gt;really&lt;/em&gt; going on?&amp;nbsp; Well, MiniMVC is handling the most importantly the OnChange event handler for the Action DependencyProperty and using that to dynamically create an ICommand class called ActionCommand.&amp;nbsp; It&amp;#39;s also looking up the Click RoutedEvent via Reflection and adding the ActionCommand&amp;#39;s Execute method as the event handler for the located Click RoutedEvent.&amp;nbsp; There is ZERO code in my code-behind.&amp;nbsp; The Designer has free-reign to apply the Controller and action to any RoutedEvent he/she chooses and we can all sleep well knowing our &lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;concerns are separated&lt;/a&gt;.&amp;nbsp; A happy marriage in my book.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;I must give a lot of credit to &lt;a href="http://devlicio.us/blogs/rob_eisenberg/default.aspx"&gt;Rob Eisenberg&lt;/a&gt;&amp;#39;s super-awesome &lt;a href="http://caliburn.tigris.org/"&gt;Caliburn&lt;/a&gt; project on which much of the Action dependency property is based.&amp;nbsp; His framework is full featured to the tilt, but is a little over done to my liking with the extensive use of Dependency Injection.&amp;nbsp; If you find MiniMVC useful, though, I highly recommend you watch for progress on Caliburn.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000"&gt;You can download the full solution, including demo&amp;#39;s, from the presentation, as well as the above example project &lt;a href="http://cromwellhaus.com/files/folders/wpf/entry581.aspx"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; &lt;blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=582" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/WPF/default.aspx">WPF</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/MVC/default.aspx">MVC</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/MiniMVC/default.aspx">MiniMVC</category></item><item><title>Quicky Visual Studio Projects you can Toss to the Curb</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/04/11/quicky-visual-studio-projects-ou-can-toss-to-the-curb.aspx</link><pubDate>Fri, 11 Apr 2008 15:16:25 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:565</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;When I&amp;#39;m trying to explain things to people or just want to try something out really quick I&amp;#39;ll often create myself a temporary Visual Studio projects that I don&amp;#39;t intend to keep around.&amp;nbsp; In fact, I have an entire Temp folder full of them.&amp;nbsp; &lt;a href="http://cromwellhaus.com/blogs/ryanc/WindowsLiveWriter/QuickyVisualStudioProjectsoucanTosstothe_9E91/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="146" alt="image" src="http://cromwellhaus.com/blogs/ryanc/WindowsLiveWriter/QuickyVisualStudioProjectsoucanTosstothe_9E91/image_thumb.png" width="244" align="right" border="0" /&gt;&lt;/a&gt;I always loved that in the VB 6.0 IDE you could choose not to save your project at all and no remnant would exist if you chose not to save.&amp;nbsp; Apparently you can do this in Visual Studio 2005 and 2008.&amp;nbsp;&amp;nbsp; Go into Tools -&amp;gt; Options and select the &lt;em&gt;Projects and Solutions&lt;/em&gt; node.&amp;nbsp; Uncheck &lt;em&gt;Save ne&lt;u&gt;w&lt;/u&gt; projects when created.&lt;/em&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Bingo.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=565" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/.Net/default.aspx">.Net</category></item><item><title>Virtual PC and Network Places</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/03/21/virtual-pc-and-network-places.aspx</link><pubDate>Fri, 21 Mar 2008 14:46:28 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:520</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I use Virtual PC a lot, especially for development.&amp;nbsp; I try to emulate a mini-infrastructure of how I&amp;#39;ll be deploying my solutions, so no SQL Server on my box, no IIS on my box, etc.&amp;nbsp; To support this I use &lt;a href="http://blogs.msdn.com/virtual_pc_guy/"&gt;Virtual PC Guy&amp;#39;s&lt;/a&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/virtual_pc_guy/archive/2005/10/04/477195.aspx"&gt;steps&lt;/a&gt; for enabling communication between my host and the VPC&amp;#39;s.&amp;nbsp; If you are on an Active Directory environment this can have a pretty negative impact on name resolution, specifically when browsing through &amp;quot;My Network Places&amp;quot; (XP) or just &amp;quot;Network&amp;quot; (Vista).&amp;nbsp; &lt;a href="http://cromwellhaus.com/blogs/ryanc/WindowsLiveWriter/VirtualPCandNetworkPlaces_978C/image_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="244" alt="image" src="http://cromwellhaus.com/blogs/ryanc/WindowsLiveWriter/VirtualPCandNetworkPlaces_978C/image_thumb_1.png" width="198" align="right" border="0" /&gt;&lt;/a&gt;If you are running into this and it bugs you, go into your Microsoft Loopback Adapter properties and disable/uncheck &amp;quot;Client for Microsoft Networks&amp;quot;.&amp;nbsp; I personally disable everything except Virtual Machine Network Services and IPv4 since this just a small private network running on my computer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=520" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Networking/default.aspx">Networking</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Virtual+PC/default.aspx">Virtual PC</category></item><item><title>So What's Your Windows Experience Score?</title><link>http://cromwellhaus.com/blogs/ryanc/archive/2008/03/21/so-what-s-your-windows-experience-score.aspx</link><pubDate>Fri, 21 Mar 2008 02:13:20 GMT</pubDate><guid isPermaLink="false">a17c0d30-89b7-4790-98da-f63884cd9e16:519</guid><dc:creator>cromwellryan</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I realize this isn&amp;#39;t the MiniMVC post I promised, but that one is a monster and I wanted to feel like I accomplished something this evening.&lt;/p&gt; &lt;p&gt;&lt;a href="http://cromwellhaus.com/blogphotos/SoWhatsYourWindowsExperienceScore_87C2/image.png"&gt;&lt;img height="168" alt="image" src="http://cromwellhaus.com/blogphotos/SoWhatsYourWindowsExperienceScore_87C2/image_thumb.png" width="240" align="right" border="0" /&gt;&lt;/a&gt;Last week I was forced to replace a dying video card which was a piece-of-junk when I bought it, but, well, I&amp;#39;m cheap.&amp;nbsp; I picked up an &lt;a href="http://www.nvidia.com/object/geforce_8600.html" target="_blank"&gt;NVIDIA GeForce 8600 GT&lt;/a&gt; and while not &lt;em&gt;the&lt;/em&gt; best, it&amp;#39;s more than I&amp;#39;ll need.&amp;nbsp; &lt;/p&gt; &lt;p&gt;When I built this rig, I picked up about the best available at the time.&amp;nbsp; Looking at my latest Windows Experience Score, I&amp;#39;m sort of regretting not picking up the Intel 6800 Core 2 Duo, though it was significantly more expensive than the 6600 I&amp;nbsp; did choose.&amp;nbsp; I guess I can&amp;#39;t fault the decision based on the facts at the time.&amp;nbsp; That said, my &lt;a href="http://www.dell.com/content/products/productdetails.aspx/xpsnb_m1530?c=us&amp;amp;cs=19&amp;amp;l=en&amp;amp;s=dhs&amp;amp;~ck=mn" target="_blank"&gt;Dell M1530&lt;/a&gt; has the 6800 and I swear it&amp;#39;s a friggin&amp;#39; beast.&lt;/p&gt; &lt;p&gt;What&amp;#39;s your score?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cromwellhaus.com/aggbug.aspx?PostID=519" width="1" height="1"&gt;</description><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Vista/default.aspx">Vista</category><category domain="http://cromwellhaus.com/blogs/ryanc/archive/tags/Hardware/default.aspx">Hardware</category></item></channel></rss>