Monthly Archives: November 2009

When User Experience doesn’t matter



I spend a great deal of time preaching the merits of user experience.  Software design is about the end user, not about my preferences as a user of software.

I particularly subscribe to the ideas in Alan Cooper’s work “Face 3” and the book the “Inmates are Running the Asylum”.  This involves researching one’s target market, creating personas typical of that market, then having those personas participate in realistic scenarios, which may or may not involve your software.

I think I’ve learnt the hard way, however, that sometimes designing the ideal user experience can be, frankly, a waste of time.

In a recent presentation, designer Joel Flom relates how designers sometimes create great designs which are gratefully received by the customer, who then proceed to take the design, consider it completely unworkable then place it in a box, never to be looked at again.   So all time spent in design, documentation and analysis is of no benefit to anyone.

Although creating a “world” (via personas and scenarios) that accurately model a user experience, we need to be careful that we do not lose sight of two highly influential factors. 

The first is ensuring that the personas we create truly do reflect the attitudes of our target market.  It’s tempting to create a persona that is a user advocate, that loves our company and wants to form a relationship with it.  This makes me feel warm inside but i don’t think it reflects every persons expectations.  Most people want to do something quickly and easily.  They’re not interested in taking us out to dinner.   Creating an elaborate “UX” for these people can be a waste of time.

The second involves the other stakeholders in the software project.  I’m talking about the analysts, developers, other designers, consultants and marketing that are expected to implement your ideas.  They have opinions too and need to be heard.  If they aren’t then they will either consciously or subconsciously sabotage or modify your grand plans beyond recognition.   

Joel provides 3 thoughts that may help.  Firstly, get a complete picture of the customer experience, not just an idealised one.  Become a student of the business, not just your customer’s business, but your own.  Understand what all the stakeholders want, particularly those responsible for implementing your solution.  Give the customer what they really need, not just what’s “cool”.  Having a more complete understanding of the problem will result in a truly effective solution.




Hosting Winforms in Firefox



I have a strange fascination with hybrids.  Combining old and new technologies in bizarre and interesting ways.   Why must developers make “the choice” between a web or native technology? It would be great to build applications that would increase or decrease in features depending on the platform they were run on.



Do you have a Winforms application that you’d like to host in a web browser?  There’s an interesting technique you can use to do this enabled by .net Framework 3.5.

The .net framework provides the ability to create WPF web applications (commonly called XBAP).  WPF has the ability, in turn, to host Winforms. 


It appears that in order to do this effectively, it’s necessary to deploy your XBAP application as a “Full Trust” application.


The code

To use this, create an XBAP project, then a page a “WinformHost” control on it.   The XAML could look like this:

<Page x:Class="Page1"
    <DockPanel LastChildFill="True">
        <Button Name="Button1"  DockPanel.Dock="Bottom"  >This is a WPF Button</Button>
        <WindowsFormsHost Name="WinformHost"   />

Then, create some code to instantiate your winform and show it on the Winform host:

Class Page1

    Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

        Dim loForm As New HelloWorldWinform

        WinformHost.Child = WinformToUserControl.GetWrapper(loForm)

    End Sub
End Class

Here’s the subroutine:

Public NotInheritable Class WinformToUserControl

    Public Shared Function GetWrapper(ByVal form As System.Windows.Forms.Form) As System.Windows.Forms.Control
        Dim loPanel As New System.Windows.Forms.Panel
        loPanel.Dock = Forms.DockStyle.Fill
        ShowFormInControl(loPanel, form)
        Return loPanel
    End Function

    Private Shared Sub ShowFormInControl(ByVal ctl As System.Windows.Forms.Control, ByVal frm As System.Windows.Forms.Form)

        frm.TopLevel = False
        frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        frm.AutoScaleMode = Forms.AutoScaleMode.Dpi

        frm.Dock = Forms.DockStyle.Fill

    End Sub
End Class


Interesting bits and pieces

We found that in order for the items inside the control to scale properly, the AutoScaleMode property on the Winform must be set to Dpi instead of the default, which is Font.  I have a feeling this is because Dpi is the mode preferred for WPF, but I am uncertain.

In the sample WinformToUserControl class I found it better to contain the Winform inside a panel rather than exposing the Winform directly.  It seemed to make it more stable.  Feel free to experiment with taking it off.


As of time of writing, Firefox on my Windows 7 64 bit machine steadfastly refuses to run xbap.  It appears the “Windows Presentation Foundation” addin has not been automatically installed.  I have no idea how to install it.  There’ appears to be no information about how to do so.  So if you have it, good for you.  If you don’t….try re-installing the .net framework 3.51 (which didn’t work for me…)

I do know there was some controversy about this addin being temporarily blacklisted by Mozilla due to security concerns last month, but that’s all over now isn’t it?  



You can download a sample project here.