<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Christopher Bennage : UI</title><link>http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx</link><description>Tags: UI</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>d:DesignInstance in Blend 4</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2010/03/29/d-designinstance-in-blend-4.aspx</link><pubDate>Mon, 29 Mar 2010 20:12:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56325</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;Let’s walk through an example of using d:DesignInstance for improving the design-time experience in Blend. For background, see my &lt;a href="http://devlicio.us/blogs/christopher_bennage/archive/2010/03/26/exploring-design-time-data-in-blend-4.aspx" target="_blank"&gt;last post&lt;/a&gt; on the topic.&lt;/p&gt;  &lt;p&gt;I’m going to be using the ContactManager sample from the &lt;a title="free WPF and Silverlight from the stone" href="http://www.codeplex.com/caliburn"&gt;Caliburn&lt;/a&gt; trunk. You can access the source of it &lt;a href="http://caliburn.codeplex.com/sourcecontrol/network/Show?projectName=caliburn&amp;amp;changeSetId=46266" target="_blank"&gt;here&lt;/a&gt; under: \trunk\samples\LOB Samples\Silverlight\ContactManager\&lt;/p&gt;  &lt;p&gt;We’re only going to concern ourselves with one view/viewmodel pair:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;ContactListView &lt;/li&gt;    &lt;li&gt;ContactListPresenter &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;(This sample code still uses Caliburn’s old naming scheme that was influenced by the MVP pattern. “Presenter” here means “View Model” for all practical purposes.)&lt;/p&gt;  &lt;p&gt;ContactListView displays a list of contacts in an ItemsControl on left side of the view. As you can see, there isn’t much visible in Blend.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;margin-left:0px;border-left-width:0px;margin-right:0px;" title="The view opened in Blend 4." border="0" alt="The view opened in Blend 4." src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_7C4AB7F3.png" width="476" height="400" /&gt; On the corresponding viewmodel, we have a property named Contacts that we’ll bind to the ItemsControl.&lt;/p&gt;  &lt;p&gt;(Note that Caliburn is binding to this property using naming conventions, but we’ll need to add an explicit binding in order to play nice with Blend.)&lt;/p&gt;  &lt;p&gt;Here’s what my ItemsControl looks like:&lt;/p&gt;  &lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;ItemsControl x:Name=&amp;quot;Contacts&amp;quot; 
              ItemsSource=&amp;quot;{Binding Contacts}&amp;quot;&amp;gt;
&amp;lt;!-- omitted for brevity --&amp;gt;
&amp;lt;/ItemsControl&amp;gt;&lt;/pre&gt;

&lt;p&gt;Let’s select the ItemsControl in Blend and examine the data binding for the ItemsSource.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="selecting the data binding editor for the ItemsSource" border="0" alt="selecting the data binding editor for the ItemsSource" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_74531591.png" width="291" height="556" /&gt; &lt;/p&gt;

&lt;p&gt;It’s a sad, empty little dialogue that greets us.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="The depressingly empty Data Context tab." border="0" alt="The depressingly empty Data Context tab." src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_13298970.png" width="616" height="578" /&gt; &lt;/p&gt;

&lt;h3&gt;Getting the Shape of Our Data Context&lt;/h3&gt;

&lt;p&gt;Let’s open up the XAML for ContactListView. In the root element, we’ll set the design-time data context using the d:DesignInstance markup extension. It looks like this:&lt;/p&gt;

&lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;UserControl xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
             xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
             xmlns:Controls=&amp;quot;clr-namespace:Caliburn.Silverlight.ApplicationFramework.Controls;assembly=Caliburn.Silverlight.ApplicationFramework&amp;quot;
             xmlns:rm=&amp;quot;clr-namespace:Caliburn.PresentationFramework.RoutedMessaging;assembly=Caliburn.PresentationFramework&amp;quot;
             xmlns:d=&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot;
             xmlns:mc=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;
             mc:Ignorable=&amp;quot;d&amp;quot; x:Class=&amp;quot;ContactManager.Views.ContactListView&amp;quot;
             xmlns:local=&amp;quot;clr-namespace:ContactManager.Presenters&amp;quot;             
             Height=&amp;quot;400&amp;quot;
             Width=&amp;quot;750&amp;quot;
             d:DataContext=&amp;quot;{d:DesignInstance local:ContactListPresenter}&amp;quot;
             rm:Message.Attach=&amp;quot;[Event Loaded] = [Action LoadContacts]&amp;quot;&amp;gt;

&amp;lt;!-- omitted for brevity --&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;

&lt;p&gt;Wow, that’s a lot of namespaces. We’re only concerned with two lines though. The first one is&lt;/p&gt;

&lt;pre&gt;    xmlns:local=&amp;quot;clr-namespace:ContactManager.Presenters&amp;quot; &lt;/pre&gt;

&lt;p&gt;This also use to reference our local type in XAML.&lt;/p&gt;

&lt;p&gt;The second is&lt;/p&gt;

&lt;pre&gt;    d:DataContext=&amp;quot;{d:DesignInstance local:ContactListPresenter}&amp;quot; &lt;/pre&gt;

&lt;p&gt;This tells Blend that we want to use the ContactListPresenter for our design-time data context. However, this doesn’t create an instance of the type and we won’t see any data appear in Blend. Instead, this tells Blend what the “shape” of our data context is. In other words, Blend uses reflection to learn about the properties so that it can show us a lot more in the data binding editor. &lt;/p&gt;

&lt;p&gt;Let’s open that up again.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="a really useful data binding engine" border="0" alt="a really useful data binding engine" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_6463D0CD.png" width="616" height="578" /&gt; &lt;/p&gt;

&lt;p&gt;Much less depressing. This also means that when I drill down and edit the ItemTemplate, Blend is aware of the data context and I get support for bindings there as well. Booya.&lt;/p&gt;

&lt;h3&gt;Getting Some Sample Data&lt;/h3&gt;

&lt;p&gt;I said earlier that d:DesignInstance does not create an instance of the specified type. You can make it create an instance though by setting the IsDesignTimeCreatable property to true. Now, we don’t want to do this with ContactListPresenter because it has a couple of dependencies injected into it’s constructor. So in order to provide a little sample data for the designer, I’ve created a new class to use as my design-time viewmodel:&lt;/p&gt;

&lt;pre class="c#:nogutter:nocontrols" name="code"&gt;public class SampleContactListPresenter
{
    public List&amp;lt;Contact&amp;gt; Contacts {get;set;}    
    
    public SampleContactListPresenter()
    {
        Contacts = new List&amp;lt;Contact&amp;gt;
        {
            new Contact{ FirstName=&amp;quot;Ford&amp;quot;, LastName=&amp;quot;Prefect&amp;quot;},
            new Contact{ FirstName=&amp;quot;Author&amp;quot;, LastName=&amp;quot;Dent&amp;quot;},
        };
    }
    
}&lt;/pre&gt;

&lt;p&gt;I could have derived this from ContactListPresenter, but that would have been a lot of unnecessary work. A better choice would be for my design-time viewmodel and my real viewmodel to implement a common interface. That would help them maintain the same shape. (An even better choice would be to use d:DesignData, but that’s another post). &lt;/p&gt;

&lt;p&gt;In this case, I decided to keep it really simple.&lt;/p&gt;

&lt;p&gt;After adding this class, I need to change the line in my XAML that creates the design-time data context to this:&lt;/p&gt;

&lt;p&gt;d:DataContext=&amp;quot;{d:DesignInstance local:SampleContactListPresenter, IsDesignTimeCreatable=True}&amp;quot;&lt;/p&gt;

&lt;p&gt;and now I can see some sample data in Blend:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="Some actual, real not-so real or actual data." border="0" alt="Some actual, real not-so real or actual data." src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_787CED56.png" width="409" height="438" /&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;N.B. I discovered after I worked through this that the ContactListPresenter in the trunk doesn’t get along well with d:DesignInstance. I haven’t isolated the exact problem yet, but you’ll&amp;#160; need to modify the class if you want to follow along with this tutorial. Change the class so that it is only inheriting from ScreenConductor&amp;lt;IContactDetailsPresenter&amp;gt;:&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;em&gt;public class ContactListPresenter : ScreenConductor&amp;lt;IContactDetailsPresenter&amp;gt;, IContactListPresenter&lt;/em&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56325" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/data+binding/default.aspx">data binding</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Blend/default.aspx">Blend</category></item><item><title>Exploring Design-Time Data in Blend 4</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2010/03/26/exploring-design-time-data-in-blend-4.aspx</link><pubDate>Fri, 26 Mar 2010 20:26:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:56294</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I’ve gleaned most of what I have learned about this topic from &lt;a title="Unni" href="http://blogs.msdn.com/unnir/archive/2009/07/12/introducing-sample-data-for-developers.aspx" target="_blank"&gt;Unni&lt;/a&gt;, &lt;a title="Karl Shifflett" href="http://karlshifflett.wordpress.com/2009/10/28/ddesigninstance-ddesigndata-in-visual-studio-2010-beta2/" target="_blank"&gt;Karl&lt;/a&gt;, and &lt;a title="Jack Ukleja" href="http://jack.ukleja.com/ddesigninstance-in-depth/" target="_blank"&gt;Jack&lt;/a&gt;. I recommend checking out their posts for additional information.&lt;/p&gt;  &lt;h3&gt;d:DataContext&lt;/h3&gt;  &lt;p&gt;The d:DataContext attribute allows you to establish a data context that is only for design time. You can use it the same way (more or less) that you use the real DataContext. Two options are available for providing data for the design-time data context. They are the markup extensions d:DesignInstance and d:DesignData.&lt;/p&gt;  &lt;h3&gt;{d:DesignInstance}&lt;/h3&gt;  &lt;p&gt;This new markup extension has three properties:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="4" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="100"&gt;Type&lt;/td&gt;        &lt;td valign="top" width="400"&gt;The type of the instance that we would like to use for design-time data context. This is the default property, so you can omit it and just provide the type value.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;IsDesignTimeCreatable&lt;/td&gt;        &lt;td valign="top" width="400"&gt;&lt;strong&gt;True&lt;/strong&gt;: create an instance of the type and use it for the design-time data.           &lt;br /&gt;&lt;strong&gt;False&lt;/strong&gt;: reflect over the type so that the data binding expression builder is aware of the members.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;CreateList&lt;/td&gt;        &lt;td valign="top" width="400"&gt;Do we want a list of instances or a single instance?&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This is mostly for giving you &lt;em&gt;the shape&lt;/em&gt; of the data that you are binding to. Though you will see the actual property values at design-time, so you can create a new type with the same shape as your real viewmodel, but with data to use for design-time (perhaps by interface, perhaps by subclassing). This approach can be tedious though, especially in cases where you need lists in design-time data.&lt;/p&gt;  &lt;h3&gt;{d:DesignData}&lt;/h3&gt;  &lt;p&gt;This markup extension has a single property, Source, that points to a xaml file describing the design-time data. The best way to create this xaml file is using Blend. Blend can automatically generate &lt;a href="http://www.lipsum.com/" target="_blank"&gt;Lorem Ipsum&lt;/a&gt; for your viewmodels (which is kinda cool). I’ll show you how to do that in a follow-up post.&lt;/p&gt;  &lt;p&gt;N.B. While everything works brilliantly in Blend, I wasn’t able to get d:DesignData to work for Silverlight in Cider (Visual Studio 2010), it complained about the leading forward slash (/) but still didn’t work when I removed it. However, removing the forward slash broke it for Blend.&lt;/p&gt;  &lt;h3&gt;A Quick Example&lt;/h3&gt;  &lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;UserControl x:Class=&amp;quot;DesignTimeTest.MyView&amp;quot;
             xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
             xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
             xmlns:d=&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot;
             xmlns:mc=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;
             mc:Ignorable=&amp;quot;d&amp;quot;
             xmlns:local=&amp;quot;clr-namespace:DesignTimeTest&amp;quot;
             d:DesignHeight=&amp;quot;300&amp;quot;
             d:DesignWidth=&amp;quot;400&amp;quot;
             d:DataContext=&amp;quot;{d:DesignInstance local:MyViewModel, IsDesignTimeCreatable=True}&amp;quot; /&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://devlicio.us/blogs/christopher_bennage/archive/2010/03/29/d-designinstance-in-blend-4.aspx" target="_blank"&gt;More on d:DesignInstance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=56294" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/data+binding/default.aspx">data binding</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/mvvm/default.aspx">mvvm</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Blend/default.aspx">Blend</category></item><item><title>Things I’d Like To Present</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2010/01/08/things-i-d-like-to-present.aspx</link><pubDate>Fri, 08 Jan 2010 11:32:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54940</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In case you are not familiar with &lt;a href="http://visitmix.com/" target="_blank"&gt;MIX&lt;/a&gt;, it is a conference from Microsoft focusing on the collaboration of design and development. Admittedly, the sessions tend to favor the developer, but there is always excellent design and UX content.&lt;/p&gt;  &lt;p&gt;&lt;a title="voting for MIX sessions" href="http://visitmix.com/opencallvote/?query=Christopher%20Bennage" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="Mix10_Vote_grn_240" border="0" alt="Mix10_Vote_grn_240" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/Mix10_5F00_Vote_5F00_grn_5F00_240_5F00_44742D31.jpg" width="184" height="244" /&gt;&lt;/a&gt; There was an open call for presentations this year and the community gets to choose which of the proposals will be selected. There are a number of &lt;a href="http://visitmix.com/opencallvote/" target="_blank"&gt;excellent proposals&lt;/a&gt; and I encourage you to go check out the list and vote for the sessions that you are genuinely interested in. (Even if you won’t be attending, the sessions will be broadcast.)&lt;/p&gt;  &lt;p&gt;Here are some sessions that I proposed for MIX10:&lt;/p&gt;  &lt;h3&gt;Cross Compiling Games for Silverlight &amp;amp; XNA&lt;/h3&gt;  &lt;p&gt;Our friend and Silverlight MVP, &lt;a href="http://blogs.silverarcade.com/silverlight-games-101/" target="_blank"&gt;Bill Reiss&lt;/a&gt;, has created an incredible library that enables you to cross compile XNA games for Silverlight. The library is called &lt;a title="a library for cross compiling XNA and Silverlight games" href="http://silversprite.codeplex.com/" target="_blank"&gt;SilverSprite&lt;/a&gt; and we feature it on Silver Arcade. (Wow, that’s a lot of ‘silvers’ in one paragraph.)&lt;/p&gt;  &lt;p&gt;In this session, we’d write a simple game for XNA (discussing some of the basic of game dev along the way) and then port the game over to Silverlight.&lt;/p&gt;  &lt;p&gt;This is an area where I wish I could spend more time. I love game development, but it’s always taking a back burner to other projects.   &lt;br /&gt;&lt;a title="Cross Compiling Games for Silverlight &amp;amp; XNA" href="http://visitmix.com/opencallvote/Entry?entryId=CROSSC046" target="_blank"&gt;[vote for this]&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;LinqToSQL and EntityFramework Profilers: Case Study&lt;/h3&gt;  &lt;p&gt;If you aren’t already familiar with the UberProf suite of ORM profilers, you can read tales of the development on &lt;a href="http://ayende.com/Blog/category/561.aspx" target="_blank"&gt;Ayende’s blog&lt;/a&gt;. Rob and I built the UI side of the application, and we learned a lot in the process. I’d like to do a talk were we discuss the challenges of the project, how we solved them, and what we did wrong. &lt;/p&gt;  &lt;p&gt;Yes, NHProf will be included too. (I submitted a case study for it last year, and it didn’t get picked. I have to sneak it in).&amp;#160; &lt;/p&gt;  &lt;p&gt;A few interesting aspects: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;we built this using MVVM, but well before &lt;a href="http://www.codeplex.com/caliburn" target="_blank"&gt;Caliburn&lt;/a&gt; reached maturity. &lt;/li&gt;    &lt;li&gt;the four separate apps (NHProf, EFProf, L2SProf, HProf) all use a single code base.&lt;/li&gt;    &lt;li&gt;we’re about to port the project from WPF to Silverlight.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a title="LinqToSQL and EntityFramework Profilers: Case Study" href="http://visitmix.com/opencallvote/Entry?entryId=LINQTO047" target="_blank"&gt;[vote for this]&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Silver Arcade: Case Study&lt;/h3&gt;  &lt;p&gt;This is a presentation that Rob and I have made a couple of times. Most recently at the Orlando .NET Users Group. We walk through the actual code for &lt;a href="http://www.silverarcade.com" target="_blank"&gt;Silver Arcade&lt;/a&gt; explaining the philosophy, design choices and mistakes we made along the way.&lt;/p&gt;  &lt;p&gt;For MIX, we would focus more design and UX choices, such as the separation of the behaviors from the views. However, we like to have a lot of audience interaction and tend to follow where ever the questions led (especially those leading questions that &lt;a href="http://scottdensmore.typepad.com/" target="_blank"&gt;Scott Densmore&lt;/a&gt; tends to ask). &lt;/p&gt;  &lt;p&gt;Silver Arcade is also interesting because&amp;#160; we deliberately used a number of newer hipper technologies; including Azure, ASP.NET MVC, jQuery, MEF, NHibernate and so on.   &lt;br /&gt; &lt;a title="case study of Silver Arcade" href="http://visitmix.com/opencallvote/Entry?entryId=SILVER048" target="_blank"&gt;[vote for this]&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54940" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Game+Development/default.aspx">Game Development</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/fun/default.aspx">fun</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XNA/default.aspx">XNA</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Software+Architecture/default.aspx">Software Architecture</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/web/default.aspx">web</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/MVC/default.aspx">MVC</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Presentations/default.aspx">Presentations</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI+Patterns/default.aspx">UI Patterns</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/viewmodel/default.aspx">viewmodel</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/mvvm/default.aspx">mvvm</category></item><item><title>Comparing Resource Dictionaries in Unit Tests</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/12/22/comparing-resource-dictionaries-in-unit-tests.aspx</link><pubDate>Tue, 22 Dec 2009 16:37:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54702</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Working on the &lt;a title="meaing NHProf, EFProf, L2SProf et al" href="http://ayende.com/Blog/category/561.aspx"&gt;ÜberProf&lt;/a&gt; has presented some interesting scenarios. As you might have picked up from Ayende’s blog, the vast majority of the source is shared between all the products. This is especially true in the UI layer. &lt;/p&gt;  &lt;p&gt;Now, Ayende wanted to have a distinct color scheme for each application. That by itself wasn’t a big deal, switching out resource dictionary is well documented and very straight forward. The architecture we choose resulted in a resource dictionary for each application with a set of identical keys. Additionally, and because of our design choices, we have to reference everything using DynamicResource. I was concerned about the possibility of omitting a key from one of the dictionaries and consequently breaking the UI. (I know that some people feel the UI is already broken. Don’t be a hater. It will get better.)&lt;/p&gt;  &lt;p&gt;I decided to write a test to compare the dictionaries and check for omitted keys. I designated the NHProf dictionary as the “master”. It is the standard that the others are compared against.&lt;/p&gt;  &lt;p&gt;Here’s what one of the actual test looks like:&lt;/p&gt;  &lt;pre class="c#:nogutter:nocontrols" name="code"&gt;public class EnsureColorsAndBrushesAreConsistentFor
{
    [Fact]
    public void LinqToSql()
    {
        var master = GetMasterListOfKeys();

        var linq2sql = new Client.Resources.LinqToSql.ColorsAndBrushes();
        linq2sql.InitializeComponent();

        var missing = from resource in master
                      where !linq2sql.Contains(resource)
                      select resource;

        Assert.True(
            missing.Count() == 0,
            MissingMessage(&amp;quot;LinqToSql&amp;quot;, missing));
    }

    private static IEnumerable&amp;lt;object&amp;gt; keys;

    private static IEnumerable&amp;lt;object&amp;gt; GetMasterListOfKeys()
    {
        if (keys == null)
        {
            var master = new ColorsAndBrushes();
            master.InitializeComponent();
            keys = master.Keys.Cast&amp;lt;object&amp;gt;();
        }
        return keys;
    }

    private static string MissingMessage(string dictionaryName, IEnumerable&amp;lt;object&amp;gt; missing)
    {
        return missing.Aggregate(
            string.Format(&amp;quot;ColorsAndBrushes.xaml for {0} is missing the following: &amp;quot;, dictionaryName),
            (seed, key) =&amp;gt; seed + &amp;quot;\n&amp;quot; + key);
    }
}&lt;/pre&gt;

&lt;p&gt;In order for this to work, I had to turn each of the resource dictionaries into a class. This is very easy to do, you only need to add the x:Class attribute to the root.&lt;/p&gt;

&lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;ResourceDictionary x:Class=&amp;quot;HibernatingRhinos.Profiler.Client.Resources.LinqToSql.ColorsAndBrushes&amp;quot;
                    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
                    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;There are similar tests for each of the applications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54702" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/uberprof/default.aspx">uberprof</category></item><item><title>Are Value Converters Evil?</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/10/01/are-value-converters-evil.aspx</link><pubDate>Thu, 01 Oct 2009 05:17:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51934</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;&lt;a href="http://blogs.silverlight.net/blogs/justinangel/"&gt;Justin Angel&lt;/a&gt; (who is undoubtedly a Silverlight Rock Star) decided to stir things up a bit on Twitter the other night.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" title="Worst practices in WPF/Silverlight: Value Converters, MultiBindings, Triggers, Markup Extensions, Element to Element binding. Talk." border="0" alt="Worst practices in WPF/Silverlight: Value Converters, MultiBindings, Triggers, Markup Extensions, Element to Element binding. Talk." src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/image_5F00_682188A6.png" width="454" height="280" /&gt;&lt;/p&gt;  &lt;p&gt;I was compelled to echo &lt;a href="http://twitter.com/wardbell/status/4489534009"&gt;Ward Bell’s response&lt;/a&gt; that value converters can play legitimate role in the UI. Justin asked me to defend my position; a reasonable request. Now, I know that I am in the minority for maintaining this position. Many heavy hitters in the WPF community think &lt;a href="http://groups.google.com/group/wpf-disciples/browse_thread/thread/3fe270cd107f184f"&gt;MVVM does away with value converters&lt;/a&gt;. (I am not going to talk about the other bits here, just value converters.)&lt;/p&gt;  &lt;h3 style="direction:rtl;"&gt;בְּרֵאשִׁית&lt;/h3&gt;  &lt;p&gt;One of the early WPF examples that got my attention was &lt;a title="I don&amp;#39;t think this is the original example" href="http://richapps.wordpress.com/2009/02/12/advanced-styling-wpf/"&gt;a listbox that was styled to look like a map of the United States&lt;/a&gt;. What impressed me in this sample was the &lt;em&gt;separation of Behavior from Feel&lt;/em&gt;. I’m using the word “feel” with a very specific meaning. We often talk about Look and Feel. I think Look is shallow and Feel is deep. You can change the look of a listbox by changing the colors, the borders, the thickness of the lines, the icon that activates the dropdown, and so on. However, even by changing all of those, it stills &lt;em&gt;feels&lt;/em&gt; like a listbox. Now, once you’ve made that “listbox” into a map of a country you’ve done something deeper. You’ve changed the Feel. Pretty significantly too, I’d say.&lt;/p&gt;  &lt;p&gt;But even with the radical feeling map-listbox, one thing you haven’t changed is the Behavior. The semantics of a listbox are still in effect. Show a list of items and allow one to be selected.&lt;/p&gt;  &lt;p&gt;But alas, those primeval glories of WPF were drowned out in the drones of “where’s my datagrid?”.&lt;/p&gt;  &lt;h3&gt;Seeking Abstractions&lt;/h3&gt;  &lt;p&gt;&lt;a title="yes, he does not have a Twitter account" href="http://devlicious.com/blogs/rob_eisenberg"&gt;Rob Eisenberg&lt;/a&gt; and I were early adopters of WPF. At the same time, we were also in the feverish rush of applying Design Patterns to everything. You know, that phase of adoption where you’ve learned how to hammer and everything’s a nail. Still, it was good for us. We were digging through &lt;a href="http://martinfowler.com/eaaDev/PresentationModel.html"&gt;Fowler’s&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx"&gt;Gossman’s&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Crevier’s&lt;/a&gt; blogs. These sources began to shape my conceptions of ViewModel (or Presentation Model or Your Mama Model), however I was still deeply influenced by my lingering notion about the separation of Behavior and Feel.&lt;/p&gt;  &lt;p&gt;The result of this is that my idea of a ViewModel is a representation of the Behavior of the View. However, the ViewModel is agnostic about the Feel. This means I don’t build “formatting” and such into my ViewModel. I try to keep my ViewModels as “pure” and abstract as possible. This also means that I rarely take strong dependencies on WPF and Silverlight.&lt;/p&gt;  &lt;p&gt;Why go to such extremes? What’s the benefit?&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;My Fantasy World&lt;/h3&gt;  &lt;p&gt;There’s a lot of talk about &lt;a title="User Experience" href="http://en.wikipedia.org/wiki/User_experience_design"&gt;UX&lt;/a&gt; lately, and perhaps more fittinhly, &lt;a href="http://en.wikipedia.org/wiki/Interaction_design"&gt;Interaction Design&lt;/a&gt; (IxD). In reality, I fiind that there are few people are actually doing IxD. Although, I think that’s the audience that Expression Blend is targeted at (do you recall &lt;a href="http://blogs.msdn.com/tims/archive/2006/01/24/516706.aspx"&gt;what Blend was originally named&lt;/a&gt;?). These chimerical Interaction Designers are the ones that would benefit the most from this proposed separation of Behavior and Feel. &lt;/p&gt;  &lt;p&gt;Let’s imagine a we’re building a WPF application. Harkening back to that old, impressive sample of yesteryear, the behavior we need in our app is to “allow the user to select a state”. As a developer, we can create a ViewModel that embodies that behavior, we can test the ViewModel, and even build a simple, naive View (testing that the required bindings are present with &lt;a title="free WPF and Silverlight from the stone" href="http://www.codeplex.com/caliburn"&gt;Caliburn&lt;/a&gt; thank you). Then we can hand it over to an interaction designer. The designer can then radically alter the Feel without changing the Behavior. In fact, if we’re using something like Caliburn’s testability framework (not available in Silverlight unfortunately), these IxD peeps can exercise a great deal of liberty in establishing the most appropriate feel for the behavior.&lt;/p&gt;  &lt;p&gt;Unfortunately, our typical approach to software development inhibits IxD’ers from working this way. The Feel is often deeply entangled in the presentation logic (or worse).&lt;/p&gt;  &lt;h3&gt;Context&lt;/h3&gt;  &lt;p&gt;I’m sure that a large majority of WPF developers might see these distinction as useless. Especially, when building Line Of Business applications. &lt;strong&gt;That’s okay&lt;/strong&gt;. Not everyone needs to do this. Many projects don’t need the additional complexity that might be introduced by thinking in this way. However, I think this is an emerging field and UX/IxD will be increasingly important. Soon it will be the distinguishing factor in commercial software.&lt;/p&gt;  &lt;h3&gt;Wait, Wasn’t This About Value Converters&lt;/h3&gt;  &lt;p&gt;Yes, and here is how they fit in. Let’s take my &lt;a href="http://devlicio.us/blogs/christopher_bennage/archive/2009/08/22/answer-the-user-s-questions.aspx"&gt;current favorite example of formatting dates&lt;/a&gt;. We have a behavior that requires communicating some date/time information to the user. Applying my philosophy to our ViewModel, the developer should expose the raw data (an actual DateTime property) on the ViewModel and leave the rest up to the IxD’er. After careful consideration, research and usability testing, the designer decides the dates need to be formatted as “[x time ago]”. (See the &lt;a href="http://devlicio.us/blogs/christopher_bennage/archive/2009/08/22/answer-the-user-s-questions.aspx"&gt;referenced post&lt;/a&gt; if that doesn’t make sense.) The designer,&lt;span title="if this is fantasy, why not go all the way"&gt; who can likely write a bit of code&lt;/span&gt;, creates a value converter to format the date value as the Feel demands.&lt;/p&gt;  &lt;p&gt;Secondly, we could conceivably have multiple Views in an application for a single ViewModel. Each View would have a different Feel, and the application (or the user) could select the most appropriate (or comfortable one). &lt;/p&gt;  &lt;p&gt;&lt;em&gt;Incidentally, when I first learned about MVC it was in the context of writing a &lt;/em&gt;&lt;a title="notice the date on this puppy!" href="http://www.adobe.com/devnet/flashcom/articles/minesweeper.html" target="_blank"&gt;&lt;em&gt;minesweeper game in Flash&lt;/em&gt;&lt;/a&gt;&lt;em&gt; where the user could switch between an isometric and top-down view.&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;In the End&lt;/h3&gt;  &lt;p&gt;In real life, we’re not very close to this. There are few IxD’ers out there and most teams don’t need to be concerned about this. That means that for most practical purposes the Simplest Thing to Do &lt;em&gt;might &lt;/em&gt;be to forego value converters and hard code formatting in the ViewModel. Value converters, just like anything else, can be abused.&lt;/p&gt;  &lt;p&gt;Nevertheless, I definitely do &lt;em&gt;not&lt;/em&gt; consider them a worse practice.&lt;/p&gt;  &lt;p&gt;If you think I’m wrong, speak up. I am willing to listen. If you’ve been burned by the use of value converters, please share.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51934" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/viewmodel/default.aspx">viewmodel</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/mvvm/default.aspx">mvvm</category></item><item><title>Designer Wanted</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/09/22/designer-wanted.aspx</link><pubDate>Tue, 22 Sep 2009 16:30:25 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51618</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;We need to contract a designer for our current project. I’m looking for one of those mythical beasts that has:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;some real graphics design skill&lt;/li&gt;    &lt;li&gt;understands (or at least cares about) usability&lt;/li&gt;    &lt;li&gt;works with Silverlight&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There is also a strong preference for someone in the NYC/NJ area.&lt;/p&gt;  &lt;p&gt;If you are interested or know someone who qualifies, please contact me through the blog.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51618" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Usability/default.aspx">Usability</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Awesome+Opportunity/default.aspx">Awesome Opportunity</category></item><item><title>Answer the User’s Questions</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/08/22/answer-the-user-s-questions.aspx</link><pubDate>Sat, 22 Aug 2009 16:27:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:50188</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;One little usability bit that I picked up from many of the Web 2.0 apps (in particular 37signals apps), is displaying date and times in a “how long since” format.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.silverarcade.com/community"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="Community page on Silver Arcade" border="0" alt="Community page on Silver Arcade" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/8222009120042PM_5F00_3725CF83.png" width="356" height="353" /&gt;&lt;/a&gt;Take a look at the &lt;a href="http://www.silverarcade.com/community"&gt;community page&lt;/a&gt; on Silver Arcade. I wanted to display when a user became a member of the community. Instead of displaying the actual date that they signed up, I choose to convert that date to “how long ago”.&lt;/p&gt;  &lt;p&gt;At first I did this just because I liked it. Then it began to dawn on me that there are reasons that I like it.&lt;/p&gt;  &lt;h3&gt;Questions&lt;/h3&gt;  &lt;p&gt;One primary purpose of any UI is answering the user’s questions. “How much credit is left in this account?” “Is this customer currently active?” “How many days are left before this explodes?”&lt;/p&gt;  &lt;p&gt;Frequently, when we are displaying dates and times we are really trying to answer questions that begin with “how long ago did …” or “how soon until …”. &lt;/p&gt;  &lt;p&gt;When we display a simple date and time, such as&amp;#160; “August 22, 2009 12:11 PM”, we are providing raw data to the user, but we really aren’t answering their question. We’re leaving the final step up to them. That’s translating that raw data into a meaningful answer for their ‘how long’ question. Every translation has a cognitive cost.&lt;/p&gt;  &lt;p&gt;This may not seem like much, but the cognitive cost adds up very quickly. This can be one of those subtle points that makes two seemingly similar interfaces &lt;em&gt;feel&lt;/em&gt; so different.&lt;/p&gt;  &lt;p&gt;I’m not saying to display every date and time in your application in this format. Instead I am saying to ask “what question will my users have and am I really answering it”.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;To be fair, this is purely anecdotal and is not backed up with any empirical evidence.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=50188" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Usability/default.aspx">Usability</category></item><item><title>One day with Balsamiq Mockups: a review</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/06/19/one-day-with-balsamiq-mockups-a-review.aspx</link><pubDate>Fri, 19 Jun 2009 04:03:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47989</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;We’ve just started a new Silverlight project and since &lt;strike&gt;our&lt;/strike&gt; &lt;em&gt;the&lt;/em&gt; &lt;a title="if you don&amp;#39;t believe, just ask him!" href="http://ayende.com/about-me.aspx"&gt;UI guy&lt;/a&gt; is not on site with us, I ended up with the task of producing screen mockups. Some interest was expressed in using &lt;a href="http://www.balsamiq.com/"&gt;Balsamiq Mockups&lt;/a&gt;, and this seemed like a good time to really take it for a&amp;#160; test drive.&lt;/p&gt;  &lt;h3&gt;What does it do?&lt;/h3&gt;  &lt;p&gt;Balsamiq is a tool for quickly authoring mockups of applications and websites. My favorite tool for doing mockups is pencil and paper (turns out that it’s really, really good). However, we needed something that we could readily show during a review meeting and my sketches don’t photocopy well.&lt;/p&gt;  &lt;p&gt;Nevertheless, I did my brainstorming on paper and I used it for my first round of reviews with the team. This left me with about a dozen pages storyboarding the core of our application. &lt;/p&gt;  &lt;p&gt;After the first review, I began recreate it with Balsamiq.&lt;/p&gt;  &lt;p&gt;In Balsamiq you start with a blank, gridded canvas and drag various UI elements from a library onto the canvas. It reminds me of Visio a bit, but without so much pain. All of the elements are styled to look like hand-drawn. This is important because it prevents anyone from assuming that the application is “done” when you’re just presenting mockups.&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="making a web page with Balsamiq" border="0" alt="making a web page with Balsamiq" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/Untitled1_5F00_016725E9.jpg" width="646" height="667" /&gt; &lt;/p&gt;  &lt;p&gt;The elements in Balsamiq are impressively intelligent. Most elements allow you to type in some content and they react intuitively to that content. I was amazed a couple of time at how smartly they responded. Balsamiq ships with about 75 elements in its library and there are more &lt;a href="http://www.mockupstogo.net/"&gt;being posted&lt;/a&gt; all the time. You cannot really extend the library yourself however, though you can incorporate your own images.&lt;/p&gt;  &lt;p&gt;Each mockup screen is a single file. They are XML so it’s source control friendly. If you are mocking up an entire application (like I was) you can link the files together. Many of the elements have a link property that you can point to any other Balsamiq files in the same directory. Once you’ve linked up some files, you can “run” your mockups in presentation mode. This allows you to navigate around the application and toggle annotations (like the sticky note in my screen shot). The presentation mode is really cool.&lt;/p&gt;  &lt;h3&gt;Should you buy it?&lt;/h3&gt;  &lt;p&gt;I think that mocking up the UI is a very useful exercise. It helps to expose the behavior of the application that you are going to build and surfaces many insights into what it &lt;em&gt;really&lt;/em&gt; needs to do. I still prefer to use paper and pencil for the initial pass. However, I found that following this up with Balsamiq forced me to think through the entire flow of my appplication. My paper storyboards had holes in them that I did not realize until I attempted to express them in Balsamiq.&lt;/p&gt;  &lt;p&gt;The reviewers were really excited to see the Balsamiq mockups and being able to walk them through the application was a definite plus for them. The tool is easy to use. I would say that any &lt;strike&gt;designer&lt;/strike&gt; developer doing UI work should be using a tool like Balsamiq.&lt;/p&gt;  &lt;p&gt;What it offers for $79 is really hard to beat. Admittedly, I don’t know what other tools are out there and how they compare. By itself, I think it definitely worth it for anyone doing UI work.&lt;/p&gt;  &lt;p&gt;Of course, there is SketchFlow. It is coming. I think that SketchFlow looks very promising, especially for us XAML guys, but it’s not available yet. I’ll let you know what I think about the overlap once I get a change to actually use SketchFlow.&lt;/p&gt;  &lt;h3&gt;Little Things&lt;/h3&gt;  &lt;p&gt;I had a couple of annoyances that are worth pointing out. &lt;/p&gt;  &lt;p&gt;First, you cannot create reusable components. For example, I had certain elements of the application that appeared in several places. I had to clone these elements, but when I needed to change them, I had to make the change in each element. (Another reason to start with pencil).&lt;/p&gt;  &lt;p&gt;I think that it would also be nice if there was a “back button” in presentation mode. Within my mockup I had a few screens that you could get too in multiple ways, however I did not have an easy way of returning the the previous screen.&lt;/p&gt;  &lt;p&gt;I also get the impression that the community around Balsamiq likes to poke fun at us PC guys. I smile politely.&lt;/p&gt;  &lt;p&gt;Finally, Balsamiq likes to keep all of the linked files open. You’ll notice an excessive number of tabs on the bottom of the screen shot. Those are all the screens within the application I was mocking. It became a little difficult to find that right one.&lt;/p&gt;  &lt;p&gt;On the whole, Balsamiq is a smart application and I expect to see great things as it matures. Many of its features are intuitive and “just work”, and that’s how I like my software to roll.&lt;/p&gt;  &lt;pre&gt;:-P&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47989" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/development+tools/default.aspx">development tools</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category></item><item><title>Displaying Today’s Date with XAML</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/03/13/displaying-today-s-date-with-xaml.aspx</link><pubDate>Fri, 13 Mar 2009 22:06:11 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:44956</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This one is easy on the brain. Some quick WPF lovin’ 101.&lt;/p&gt;  &lt;p&gt;I need to display the current date, and have it formatted like this:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Friday, March 13, 2009&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In my opinion, this is purely a matter for the view and so I’m handling it entirely in the xaml. Here’s the markup:&lt;/p&gt;  &lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;TextBlock Text=&amp;quot;{Binding Source={x:Static sys:DateTime.Today},
           StringFormat=&amp;#39;{}{0:dddd, MMMM dd, yyyy}&amp;#39;}&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;And now for a quick analysis.&lt;/p&gt;

&lt;p&gt;I wanted to use the builtin DateTime structure, because there is no need for me to expose the current time through my presentation/view model. In my root element, I create a namespace alias:&lt;/p&gt;

&lt;pre class="xml:nogutter:nocontrols" name="code"&gt;xmlns:sys=&amp;quot;clr-namespace:System;assembly=mscorlib&amp;quot;&lt;/pre&gt;

&lt;p&gt;This allows me to reference DateTime in the markup. Since DateTime has a static property, I can get at it using &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.markup.staticextension.aspx" target="_blank"&gt;StaticExtension&lt;/a&gt;. So far, that explains {x:Static sys:DateTime.Today}. I’m working from the inside out.&lt;/p&gt;

&lt;p&gt;Inside the binding, I need to set the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding.source.aspx" target="_blank"&gt;Source&lt;/a&gt; property because otherwise the binding is looking to the DataContext. We don’t care about the context, we just want to directly access the value of DateTime.Today.&lt;/p&gt;

&lt;p&gt;Finally, we have &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.data.bindingbase.stringformat.aspx" target="_blank"&gt;StringFormat&lt;/a&gt;. It’s a tasty little bit that was introduced in 3.5sp1. You can pass it any of your standard formatting strings and it just works. Let’s say that I want to display this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today is Friday March 13.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I could used:&lt;/p&gt;

&lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;TextBlock Text=&amp;quot;{Binding Source={x:Static sys:DateTime.Today},
           StringFormat=Today is {0:dddd, MMMM dd}}&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;Notice that my quotes from the first example were omitted. They are actually optional. I like to include them though for readability.&lt;/p&gt;

&lt;p&gt;You might also have notice in the first example an extra set of angle brackets. If your formatting string starts off with an angle bracket, the Xaml parser gets confused. It thinks that it’s encountering another markup extension. We have to use an escape sequence and in Xaml it’s &lt;a href="http://msdn.microsoft.com/en-us/library/ms744986.aspx" target="_blank"&gt;{}&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once final note, DateTime doesn’t raise any change notification. So don’t expect the view to be update as the time changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=44956" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Tips+_2600_amp_3B00_+Tricks/default.aspx">Tips &amp;amp; Tricks</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/101/default.aspx">101</category></item><item><title>Testing Bindings In WPF</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/02/19/testing-bindings-in-wpf.aspx</link><pubDate>Fri, 20 Feb 2009 03:56:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:44397</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;I was inspired to get off my duff and blog today by &lt;a title="seriously, it&amp;#39;s voyeurism" href="http://twitter.com/shanselman/statuses/1228349932" target="_blank"&gt;a tweet from Scott Hanselman&lt;/a&gt;. I didn’t really dig into the context of his tweet, but it was about TDD and WPF. In case you haven’t figured it out, I’m a big fan of WPF and TDD. Luckily, I’ve had the opportunity to work on a number of varied WPF projects (most using TDD) over the last couple of years. One problem I experienced over and over was incorrect bindings in my Xaml (as I alluded to in &lt;a href="http://devlicious.com/blogs/christopher_bennage/archive/2009/01/19/ui-patterns-for-wpf.aspx" target="_blank"&gt;this post&lt;/a&gt;). Binding errors are silent. They sneak up on you ninja-like. If you are keeping an eye on your Output window you can catch them, but it is very easy for them to just slip by.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="Karate Lessons" border="0" alt="Karate Lessons" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/iStock_5F00_000004919619XSmall_5F00_18DE0A5B.jpg" width="240" height="159" /&gt;About two years ago, Rob and I were working on a student records application for the &lt;a href="http://music.fsu.edu/" target="_blank"&gt;FSU College of Music&lt;/a&gt;. The system handled the entire lifecycle of a student, from application to graduation, and that involved lots of data. We had a number of screens in the app that were merely large data entry screens. Binding errors where a problem, and it seemed like a new batch showed up every time we made a release to the users.&lt;/p&gt;  &lt;p&gt;The errors might have been the result of renaming a bound property, bad spelling, or some other such silliness. They were easy mistakes to make and thus I began to think that we really needed a way to automatically test them.&lt;/p&gt;  &lt;p&gt;Well, I’m lazy and time passed (maybe a year) and then I mentioned it again to Rob. The next day he committed a prototype to the &lt;a title="free WPF and Silverlight from the stone" href="http://www.codeplex.com/caliburn"&gt;Caliburn&lt;/a&gt; trunk. (&lt;a title="No, Ayende and Rob are not Jesus, but I couldn&amp;#39;t resist the allusion." href="http://www.youtube.com/watch?v=jQcNiD0Z3MU" target="_blank"&gt;He’s like my own personal Ayende&lt;/a&gt;.)&lt;/p&gt;  &lt;p&gt;Here’s an example test copied directly from Caliburn’s &lt;a href="http://www.codeplex.com/caliburn/Wiki/View.aspx?title=Unit%20Testing%20Data%20Bindings&amp;amp;referringTitle=Table%20Of%20Contents" target="_blank"&gt;documentation&lt;/a&gt;:&lt;/p&gt;  &lt;pre class="c#:nogutter:nocontrols" name="code"&gt;public class TestBase
{
    static TestBase()
    {
        var app = new MyApplication();
        app.InitializeComponent();
    }
}&lt;/pre&gt;

&lt;pre class="c#:nogutter:nocontrols" name="code"&gt;[TestFixture]
public class TestCase : TestBase
{
    [Test]
    public void Test()
    {
        var validator = Validator.For&amp;lt;MyUserControl, MyModel&amp;gt;();
        var result = validator.Validate();

        Assert.That(result.HasErrors, Is.False, result.ErrorSummary);
    }
}&lt;/pre&gt;

&lt;p&gt;In TestBase, we initialize the actual application so that we have access to application level resources. We need to this in a static constructor because we don’t want more than one instance of the application in the AppDomain. &lt;/p&gt;

&lt;p&gt;Now, check out the Test() method. The static class Validator.For&amp;lt;T,K&amp;gt;() method returns an instance of BindingValidator&amp;lt;K&amp;gt;. The type T is some FrameworkElement that contains the bindings we’re interested in and K is the type that the FrameworkElement is bound to. Calling the Validate() method causes Caliburn to instantiate T, crawl it’s tree, and collect all the bindings. It then compares those bindings to the type K to see if they are valid. Validate() actually returns an instance of ValidationResult&amp;lt;K&amp;gt;, which is a summary of everything that Caliburn found while comparing the bindings against the actual type T. &lt;/p&gt;

&lt;p&gt;The assertion in the test means that we expect Caliburn to find no errors, and if it does to provide us the summary. This is useful because there might be a number of binding errors and the ErrorSummary will give us the whole list.&lt;/p&gt;

&lt;p&gt;At this point, I’m just repeat what’s stated in Caliburn’s documentation. &lt;a title="you know you want it!" href="http://nhprof.com/" target="_blank"&gt;NH Prof&lt;/a&gt; was the first project where we’ve actually used the Testability features of Caliburn. Let’s check out a real live test from it:&lt;/p&gt;

&lt;pre class="c#:nogutter:nocontrols" name="code"&gt;[TestFixture]
public class MessageBoxViewTextFixture : ViewTestFixtureBase
{
    private readonly ValidationResult&amp;lt;MessagePresenter&amp;gt; bindings;

    public MessageBoxViewTextFixture()
    {
        bindings = Validator.For&amp;lt;MessageBoxView, MessagePresenter&amp;gt;()
            .Validate();
    }

    [Test]
    public void BindingsDoNotHaveErrors()
    {
        Assert.That(bindings.HasErrors, Is.False, bindings.ErrorSummary);
    }

    [Test]
    public void MessageIsBound()
    {
        Assert.That(bindings.WasBoundTo(x =&amp;gt; x.Message));
    }
}&lt;/pre&gt;

&lt;p&gt;This test is for the view that displays a simple popup message. We have a simple presenter that backs the view and it has a message to display in its property Message. It’s tested independent of the view. (This is nice because we have a case in NH Prof where a single presenter might be bound to multiple views.)&lt;/p&gt;

&lt;p&gt;The ViewTestFixtureBase is identical to TestBase from the example above. Since it’s expensive to have Caliburn instantiate and crawl the UI validating the bindings, we only want to do this once. (I’m not really sure why I used the constructor, instead of [TestFixtureSetUp], but I did.) &lt;/p&gt;

&lt;p&gt;The first test covers 90% of what you typically need, catching spelling errors, etc. The second test however explicitly checks to see if we are bound to the Message property on the presenter. This is useful because that’s the core reason for this view. There may be other properties bound, but this is the one we definitely care about. (I think this affords liberty to designers while ensuring that a view delivers the business value that was intended.)&lt;/p&gt;

&lt;p&gt;Now, let’s pretend that I have a bad binding in my markup. Here’s the core snippet for the view used in the test above, MessageBoxView:&lt;/p&gt;

&lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;Grid MaxWidth=&amp;quot;260&amp;quot;&amp;gt;
    &amp;lt;StackPanel&amp;gt;
        &amp;lt;TextBlock Foreground=&amp;quot;{StaticResource Text}&amp;quot; 
                   FontSize=&amp;quot;14&amp;quot;
                   TextWrapping=&amp;quot;Wrap&amp;quot;
                   Text=&amp;quot;{Binding Messyage}&amp;quot; /&amp;gt;
        &amp;lt;Button Content=&amp;quot;OK&amp;quot;
                Margin=&amp;quot;4 8 4 4&amp;quot;
                HorizontalAlignment=&amp;quot;Center&amp;quot;
                IsCancel=&amp;quot;True&amp;quot; /&amp;gt;
    &amp;lt;/StackPanel&amp;gt;    
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;Oops, I misspelled Message in the binding! When I execute my tests, they both fail. The first because there is a binding error and the second because it can’t find Message. Here’s the actual exception from the first test:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;NUnit.Framework.AssertionException:&amp;#160;&amp;#160; [MessageBoxView.Grid.StackPanel.TextBlock] The property &amp;#39;Messyage&amp;#39; was not found on &amp;#39;MessagePresenter&amp;#39;. 
    &lt;br /&gt;&amp;#160; Expected: False 

    &lt;br /&gt;&amp;#160; But was:&amp;#160; True&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice that it actually gives you the path to the offending binding: &lt;em&gt;MessageBoxView.Grid.StackPanel.TextBlock&lt;/em&gt;. Now that’s just cool! Thanks Rob!&lt;/p&gt;

&lt;p&gt;I can’t explain how much pain it saves to be able to do this. If you are doing TDD with WPF, you really need to check this out.&lt;/p&gt;

&lt;p&gt;I’ll post over the weekend some tests that are a bit more BDD in their styles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=44397" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/TDD/default.aspx">TDD</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI+Patterns/default.aspx">UI Patterns</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Caliburn/default.aspx">Caliburn</category></item><item><title>Garbled Text in WPF</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/02/16/garbled-text-in-wpf.aspx</link><pubDate>Mon, 16 Feb 2009 21:41:18 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:44284</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;We&amp;#39;ve had a number of rendering issues with NH Prof. I&amp;#39;ve been embarrassed about how frequently I have asked users to update their video drivers. It’s not surprising to encounter driver issues &lt;em&gt;occasionally&lt;/em&gt; with WPF. It is built on top of DirectX you know. (In fact, all my WPF apps break horribly when I enable SLI mode.) However, too many people were reporting problems with NH Prof, and that led us to think that something else was going on.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px;display:inline;border-top:0px;border-right:0px;" title="Please help me, I&amp;#39;m ugly!" border="0" alt="Please help me, I&amp;#39;m ugly!" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/UGLY1_5F00_7DB8FF4F.png" width="280" height="139" /&gt; During a shared coding session using Microsoft’s &lt;a href="http://en.wikipedia.org/wiki/Microsoft_SharedView" target="_blank"&gt;SharedView&lt;/a&gt; we noticed some of the graphical glitches that users were complaining about. This was important because we had not been able to reproduce any of these problems previously. Discovering this, I was able to create a sample application to help me isolate the problem. The symptom is garbled text. It’s interesting to point out that the text is only garbled when the window containing the text is over certain elements in &lt;em&gt;other&lt;/em&gt; applications. Usually the culprit elements were the &lt;a href="http://en.wikipedia.org/wiki/User_interface_chrome" target="_blank"&gt;chrome bits&lt;/a&gt; of another window or control. Moving the offending window with garbled text would result in an effect that looked as if the text was transparent… Hmm…&lt;/p&gt;  &lt;p&gt;Here is the Xaml sufficient to reproduce the issue:&lt;/p&gt;  &lt;pre class="xml:nogutter:nocontrols" name="code"&gt;&amp;lt;Window x:Class=&amp;quot;GarbledTextTest.Window1&amp;quot;
        xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
        xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
        Title=&amp;quot;Garbled Text Test&amp;quot;
        AllowsTransparency=&amp;quot;True&amp;quot;
        WindowStyle=&amp;quot;None&amp;quot;
        Height=&amp;quot;300&amp;quot;
        Width=&amp;quot;300&amp;quot;&amp;gt;
    &amp;lt;Grid MouseLeftButtonDown=&amp;quot;Grid_MouseLeftButtonDown&amp;quot;
          Background=&amp;quot;Black&amp;quot;&amp;gt;
        &amp;lt;TextBlock Text=&amp;quot;Help me!&amp;quot;
                   FontSize=&amp;quot;32&amp;quot;
                   Foreground=&amp;quot;#cfff&amp;quot; /&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/Window&amp;gt;&lt;/pre&gt;

&lt;p&gt;(By the way, the event handler in the Xaml is just for me to drag the window around.)&lt;/p&gt;

&lt;p&gt;But remember, I said that the developers were not experiencing the problem, so what else gives? I also mentioned that we noticed this while using SharedView. &lt;img style="border-bottom:0px;border-left:0px;margin:2px 0px 0px;display:inline;border-top:0px;border-right:0px;" title="going back to a classic" border="0" alt="going back to a classic" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/goingbacktoaclassic_5F00_75C15CED.png" width="414" height="459" /&gt;In fact, we fixed it in NH Prof during that same session. Something was special about SharedView. I recalled that SharedView used to tell me that it was disabling Aero when I started it (It doesn’t always do so, but I didn’t bother to find out why.) So I just disabled it myself by changing my theme back to Windows Classic.&lt;/p&gt;

&lt;h3&gt;Okay, so…&lt;/h3&gt;

&lt;p&gt;What does all this add up to? It seems that three different things stacked up to cause the rendering bug. &lt;/p&gt;

&lt;p&gt;The first bit of wonkiness is the&amp;#160; &lt;strong&gt;AllowTransparency&lt;/strong&gt; property on the &lt;strong&gt;Window&lt;/strong&gt; element. If I set this property to false, the problem goes away. This wasn’t really an option for NH Prof as we preferred the custom chrome and need the transparency.&lt;/p&gt;

&lt;p&gt;Second, the brush used for the text had partial opacity. It might not jump out at you, but the value #cfff translates to &lt;em&gt;white with 80% opacity&lt;/em&gt;. If I make the brush 100% opaque, the problem goes away. That’s actually how we fixed it.&lt;/p&gt;

&lt;p&gt;Of course, the third way was the doozy, and I can only qualify it as an Unhappy Rendering Environment. It might be an out of date driver, a remote desktop, your pretty Vista theme being disabled, or a picture of an angry monkey.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;By the way, if you find any more of these glitches in NH Prof, please post about it in the &lt;a href="http://groups.google.com/group/nhprof" target="_blank"&gt;forums&lt;/a&gt;. Also, there are other issues around rendering that are not related to this.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=44284" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/XAML/default.aspx">XAML</category></item><item><title>UX Patterns (and not UI Architecture Patterns)</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2009/02/05/ux-patterns-and-not-ui-architecture-patterns.aspx</link><pubDate>Thu, 05 Feb 2009 19:19:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43983</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;Just when you think that you finally have an accurate label to describe something, you discover the true ambiguity of the term.&lt;/p&gt;  &lt;h3&gt;What is UX?&lt;/h3&gt;  &lt;p&gt;UX means &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/User_experience" target="_blank"&gt;User Experience&lt;/a&gt;&lt;/em&gt;. You might say that it is the &lt;em&gt;ergonomics&lt;/em&gt; of an user interface, or possibly the&lt;em&gt; level of intuitiveness&lt;/em&gt;. More plainly, good UX means that the users of the software are able to quickly understand how to use and don’t have to go out of their way to make things happen. This blurs a little bit into the concept &lt;a href="http://en.wikipedia.org/wiki/Usability" target="_blank"&gt;Usability&lt;/a&gt;. But UX just sounds so much sexier, and there is this aspect of producing chemistry between the user and software that transcends mere Usability.&lt;/p&gt;  &lt;p&gt;Why do I bring this up? Well, I’ve just started talking about &lt;a href="http://devlicious.com/blogs/christopher_bennage/archive/2009/01/19/ui-patterns-for-wpf.aspx" target="_blank"&gt;UI Architecture patterns&lt;/a&gt; and I wanted to make sure the concepts were distinct. When I talk about UI architecture patterns I’m talking about the structure of the code that underlies a user interface. It’s all non-visual stuff. On the other hand, UX patterns deal with the rendered view that is presented to the user.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/Quince_5F00_2E46BB8C.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 0px 4px;display:inline;border-top:0px;border-right:0px;" title="Quince" border="0" alt="Quince" align="right" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/Quince_5F00_thumb_5F00_5BC7DB4F.png" width="244" height="47" /&gt;&lt;/a&gt;Infragistics just recently published a very cool (and Silverlight-based) catalog of UX Patterns called &lt;a href="http://quince.infragistics.com/" target="_blank"&gt;Quince&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You might be inclined to say, “Well, that’s nice for designers, but…”. Please don’t, this is really a useful for tool for anyone building user interfaces, even if those interfaces are basic and handed off to a design team. In the very least, this will help establish a common vocabulary for talking about user interfaces.&lt;/p&gt;  &lt;h3&gt;More Resources&lt;/h3&gt;  &lt;p&gt;If you are interested in know more about UX and usability, here’s a couple of resources: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.useit.com/" target="_blank"&gt;Jakob Nielsen&lt;/a&gt; – very well know and full of good info, but he is definitely plain usability with none of the sizzle.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0321344758?ie=UTF8&amp;amp;tag=bluspiconinc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321344758" target="_blank"&gt;Don’t Make Me Think&lt;/a&gt; – one of the first books I read on the subject. (I probably need to reread it, it’s been so long…)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=43983" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI+Patterns/default.aspx">UI Patterns</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/Usability/default.aspx">Usability</category></item></channel></rss>