Friday, July 30, 2010
 
   
 
Welcome to my site

First let me say thanks for stopping by my site. My name is David Hanson-Graville and I am a IT consultant working in the UK. Let me make it clear, I am passionate about technology and specifically .net and its various forms. I've programmed in a range of langages, but I can say, I am now at my happiest when coding with c#. I hope my blog is an enjoyable & educational read and please feel free to email me at David.Hanson@OnTheBlog.net if you have any questions. 

OnTheBlog Minimize
Author: David Hanson Created: Wed, 02 Jan 2008 20:28:49 GMT
All things .net, wpf, XAML, C#, Workflow Foundation and many more.

WPF: Extending the Page & UserControl base classes
By David Hanson on Mon, 25 Feb 2008 22:50:15 GMT

When working with different .NET technologies it is often good practice to extend a number of bases classes for your own requirements.  There are couple of benefits for doing this.

  •  The derived classes provide a layer of protection/abstraction from the core framework so that changes can be managed more effectively. 
  • The derived classes provide the ability for you to extend base behaviour and share that throughout your application. 
  • You can increase testability.

Generally, when starting a new development, I like to do some of this infrastructure work upfront, this saves me a lot of refactoring down the line when I realise I need to extend a base class. Following this approach is particularly useful when working with .NET UI technologies such as WinForms, ASP.NET and WPF which implement a number of base classes upon which the majority of UI components are based. 

Below is an example of the standard WinForms model whereby each Form is derived from System.Windows.Forms.Form versus the model I implement when I intend to extend the base Form class.

 

FormEx implementation

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace Extended.Base.Example
{
    public class FormEx: Form
    {
    }

}

Our StandardForm implementation

using System;
Comments (0) More...

WPF Ribbonbar and more coming in 2008!
By David Hanson on Thu, 21 Feb 2008 12:32:42 GMT

Scott Gu has shed some light on some of the changes coming to WPF this year. Notably, Scott inidcates that there will be new contols for WPF, one of which is a new a "Ribbon" control. I have thought that for a while that Microsoft needed to get this control to market as the Office 2007 styling has become quite popular.

There are a number of vendors that do offer a WPF ribbon these are shown below.

Also it seems more graphic intensive features such as shadowing etc are being pushed onto the graphics hardware increasing performance. V.cool!

Comments (0)

Silverlight 2.0! Cant wait!
By David Hanson on Mon, 18 Feb 2008 13:44:39 GMT

I have just finished listening to Scott Gu's comments on Silverlight 2.0. From what he is saying 2.0 should finally offer the level of functionality to truly make Silverlight a compelling option.

Just to summarise....Silverlight 2.0 will get the following.

  • Large suite of controls for developing LOB style applications
  • Databinding support
  • Styling and control templating
  • Flowlayout support
  • WCF Communications stack support

Good news!

Comments (0)

Alt.NET Seattle
By David Hanson on Fri, 15 Feb 2008 10:24:49 GMT

Having attended the Alt.net UK conference a few weeks ago I am disappointed by the fact that I cannot make the US event. There's going to be some great people there and the chance to discuss topics with them would have been great.

I am making sense of my decision using the following.

  • Its expensive to head over to the US just for a conference.
  • I am  getting married this year and need to save some money.
  • The "Mrs" gets jealous and thinks its a holiday.
  • There will be other events.

With that I rest my case.

Comments (0)

Random muttering: Visualising Test Coverage
By David Hanson on Mon, 18 Feb 2008 19:56:16 GMT

Ok, this one will is going to sound a little odd but bare with me. The other day I received a call from a friend who I used to work with. He’s now moved on to a new company and is responsible for managing a team of developers who have been focused on developing internal systems.  

Upon starting with the company, the IT director had expressed his concerns that the development teams were generally gun ho about configuration management and that on many occasions critical systems had been down for extended periods. Basically, my friends role is to get a grip with these kind of issues and improve the overall quality and professionalism of the team.

He told me that the systems had been written in .net 1.1 and very little progress had been in terms of migrating them to 2.0 and definately no 3.5. Another key issue he had identified was that the application had absolutely no code coverage and therefore developers were unaware of what impact their changes could have to the behaviour of the applications. I think more to the point, as we discussed the environment, it became apparent that the majority of developers had very little understanding TDD and the benefits it can bring to your project.  

Given the environment, my friend and I discussed a number of options that he could take forward in terms of educating the team in the ways of TDD and primarily some way of obtaining some level of test coverage of the application code. It was the later thread that sparked an interesting conversation about conceptualising a test and how you can get increase coverage from a small number of tests. He had explained that the architecture was fairly standard with a complex model that uses fine-grained interfaces for business entities wrapped up with a coarse-grained interface that is exposed to the UI.

 

Discussing the split between UI code and service/business code it seemed there was approximately 30/70 split. Therefore, we both felt the best place to start would be at the service contract layer. The service contract provides a single point of access into a complex system. This is a very key point, what it essentially means is that by using the service contract and multiple data scenarios we can cover large portions of code within the complex model. To help developers visualise this concept, we talked through a few analogies that would fit.  Below are 3 visualisations of this.

Lightning Forks

Ants nest paths

Tree root system

As you can see, each of these images can be used to visualise the many branches of code that could possibly be taken from the top down entry point. Exploring these different paths takes a multitude of data scenarios. Each data scenario being passed into the top level entry point results in decisions being made on that data at each ...

Comments (0) More...

Visual Studio Xmas tree settings
By David Hanson on Fri, 08 Feb 2008 15:55:53 GMT

Most developers spend the majority of their day with their head stuck inside visual studio,  I’m no different, so as a result I like to customize my editor so that I am as comfortable as possible.  Its in this area i’m a little old fashioned. I can’t stand the default white colour settings that visual studio offers, therefore I spend quite some time tuning them so they meet my needs.  Below is an example my code windows in visual studio. I really like these settings and I feel it makes the code far more readable and items such as strings, numbers, operators, keywords and regions are all specifically coded.

Many of my colleagues have commented that my settings make my code window look like a Christmas tree. So if your feeling like you want to be a little festive then you can grab them here.

Comments (0)

Alt.Net UK Conference
By David Hanson on Thu, 07 Feb 2008 10:57:52 GMT

As some of you may know..... and some may not, I have been working with Conchango on a project for the last 9 months. The conchango guys are great to work with, so when they asked if I wanted to attend the Alt.Net conference this weekend (as they were hosting it), I was chuffed as originally I had thought I had missed the registrations.

The conference was broken up over two days. Friday was a meet and greet session in the evening, everyone gets the opportunity to propose a session that they would like covered on the Saturday. I was really impressed with the topics that were up for discussion, my two offerings were "Declarative Programming & Testability" and "Why use ORM".

After filling the whiteboard with post it notes, I was amazed to see just how many where were related to testing and general quality of development. Having defined a rough agenda for the Saturday, everyone headed off to the Bankside bar where we could get to know each other. I couldn't stay too long as getting home takes an hour and half and had been at work all day I was a little shattered.

Over the next week I will be updating you about the sessions I attended and some of the key conclusions I came to. Generally though, I thought the conference was a great success. I got to meet some fantastic people and validate my ideas against others... oh and play a little table football. Many thanks must go to Ian Cooper, Alan Dean and Ben Hall for great organisation.

 

Comments (0)

Visual Studio Ribbon Bar
By David Hanson on Thu, 07 Feb 2008 10:56:59 GMT

Last night I awoke around 3am in a state of panic. What you ask could be making me worry? The answer is simple.....

Visual Studio implementing the Ribbon Bar 

Lucky for me it was just a dream..........it was wasn't it?

Comments (0)

Is BizTalk as a product dead?
By David Hanson on Fri, 08 Feb 2008 15:51:18 GMT

Last weekend I was at a wedding fair with my fiancée looking at the last remaining big things we need to get sorted for our wedding in August. While there, I ran into my brother in-law (to be) who is also getting married. As he works at my old company we naturally ended up talking shop. During this time  the girls were browsed for fairy dust or something. (I think it’s fair to say we aren't really there by choice. :-))

So during our discussion he told me about his boss asking him to get some Microsoft certs and he had a choice between BizTalk and SharePoint. At the time I said get the SharePoint certs as they are far more likely to get you a job in the future as SharePoint is generally more popular in the enterprise. After that I moved on and forgot about things.... until today.

As I was going for a walk during my lunch time I started to think about Microsoft’s current strategy for BizTalk and how there seems to be this awkward situation now that windows workflow has arrived. Having worked with both WF and BizTalk it is clear where the difference are between the products. I have listed these below.

1.) BizTalk is the enterprise solution and can scale (albeit costly), workflow is not currently seen this way.

2.) BizTalk comes with a set of adaptors/accelerators for EAI, workflow has WCF, but custom formats such as EDI are not backed in.

3.) BizTalk provides sophisticated BAM. Some work has been carried out to allow Workflows to integrate with BizTalk’s BAM but this can be considered just an integration point with BizTalk.

4.) BizTalk comes with productivity tool like the mapper. XSLT is still a rare skill and the mapper is not available for WF.

5.) BizTalk has a sophisticated rules engine. Workflow does not.

6.) BizTalk comes with Health and Activity monitoring.

Although there are many additional enterprise features that BizTalk has offer over WF, there is one issue and that needs to be addressed. That is, that Microsoft now has two retail workflow/orchestration engines. 

Having two workflow engine technologies is just not right, and Microsoft has recognised that. As a result  WF is due to be integrated into future versions of the BizTalk product.  However doing so raises a number of questions around the value of BizTalk as a product on its own right.  If WF provides the core orchestrations (which is really the selling point of BizTalk) then surely the other features of BizTalk are just extension to WF? 

Sample design surface for WF below< ...

Comments (2) More...

70-502, 70-503, 70-54 Microsoft .net 3.5 Certification
By David Hanson on Thu, 07 Feb 2008 10:56:15 GMT

So last year I updated my MCSD to the .net 2.0 certifications that included features such as generics etc. I left that update a little late in the day as I had not really had a need to update them and they felt like small extensions to the 1.1 certs I had already achieved.

Over the last year and half I have been workign with .NET 3.0 technolgies, 3.0 brings a raft of new technolgies to the developer. The 3 core technolgoy center pieces being WPF, WF and WCF.

As a result I have been eagerly awaiting the .net 3.0 exams in order to keep my certification up to date. It seems however microsoft have decided to skip by 3.0 certs and go straight to 3.5. Either way I'm happy and I will be boooking myself in in the not too distant future.

Exam 70-502 Microsoft .NET Framework 3.5 - Windows Presentation Foundation. Expected to be released in February 2008. http://www.microsoft.com/learning/exams/70-502.mspx

Exam 70-503 Microsoft .NET Framework 3.5 - Windows Communication Foundation. Expected to be released in February 2008. http://www.microsoft.com/learning/exams/70-503.mspx

Exam 70-504 Microsoft .NET Framework 3.5 - Windows Workflow Foundation. Expected to be released in March 2008.  http://www.microsoft.com/learning/exams/70-504.mspx

 

Comments (0)

3.5 .Net Framework Souce Release
By David Hanson on Thu, 07 Feb 2008 10:55:06 GMT
Over the weekend I had a play with the new .NET framework source code release which now allows you to debug into framework classes as part of your standard debugging. The source gives a good insight into how classes have been built and can often help in understanding their behaviour. Also it comes with the original comments which can be quite enlightening.  You can only do this from visual studio 2008 and most of the .net framework including WPF can be debugged.
 
 
Couple of funny comments in the code that I found from initial play below.
 
                Optimistic developer
                    // Note: This doesn't work on Win9x.  We can implement this
                    // functionality on Win9x by writing a 16 bit DLL and
                    // calling the LAN Manager method NetWkstaGetInfo().  See
                    // http://support.microsoft.com/support/kb/articles/Q155/6/98.asp
                    // We don't have the time to implement this in V1. Hopefully
                    // by the time V2 rolls around, everyone will run Windows XP.
 
      Hacking is part and parcel of the MS Job. J
        // HACK HACK HACK - when we change RightToLeft, we need to change the scrollbar thumb.
        // We can't do that until after the control has been created, and all the items added
        // back. This is because the system control won't know the nMin and nMax of the scroll
        // bar until the items are added. So in RightToLeftChanged, we set a flag that indicates
        // that we want to set the scroll position. In OnHandleCreated we check this flag,
Comments (0) More...

WPF text trimming
By David Hanson on Thu, 07 Feb 2008 10:49:52 GMT

Here’s a useful tip for you budding WPF aficionados out there.  If there is any chance that the text in a textblock may become truncated (the databound text may not fit or the window may be resized), assuming you don’t want the text to wrap (where you would use the TextWrapping attribute), add the TextTrimming attribute.  Your options are None (no ellipse – default), WordEllipse (an ellipse is inserted after the last word that fits) or CharacterEllipse (an ellipse is inserted after the last character that fits).

Example from MSDN

<TextBlock 
  Name="myTextBlock" 
  Margin="20" Background="LightGoldenrodYellow" 
  TextTrimming="CharacterEllipse" TextWrapping="NoWrap"
  FontSize="14"
>
  One<LineBreak/>
  two two<LineBreak/>
  Three Three Three<LineBreak/>
  four four four four<LineBreak/>
  Five Five Five Five Five<LineBreak/>
  six six six six six six<LineBreak/>
  Seven Seven Seven Seven Seven Seven Seven
TextBlock>

Results in

Hope it helps.

Comments (3)

WPF Bug... ListView within a Listbox
By David Hanson on Thu, 07 Feb 2008 10:49:52 GMT

I was recently having issues with a XAML structure I was working on. The stucture of my XAML was as follows.

LISTBOX (Bound to collection of custom objects)

{Item Template}

ListView (Bound to Collection of Child Objects that hangs of the Parent binding)

Now when I ran the app I got the binding firing for each parent and associated child collection but when the xaml renders only the first listboxitem has a listview bound below it. Is this a bug in the way ListViews work when nested within a Listbox's data template?

The answer it turns out is a big YES. Apparently, this is a know issue in WPF. In order to resolve this issue you need to make sure that all your datatemplates are moved to resources. Only then will the databinging and rendering work.

My XAML is show below for reference.

Window x:Class="WpfApplication1.Window1" xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title="Window1" Height="300" Width="300" >
<StackPanel VerticalAlignment="Stretch" >
<Button Click="Button_Click">Run Test</Button>
<ListBox Name="ParentListBox&q ...

Comments (1) More...

DotnetNuke the great platform.
By David Hanson on Thu, 07 Feb 2008 10:49:52 GMT

Started created my new site with DNN. I have used this product for years now and it keeps getting better. I have worked on many large scale enterprise implementation using the platform and I am hoping to blog about some of the issues you have when trying to scale the platform. As for my site its just going to be a place for me to blog so hopefully I wont need to concern myself with these matters!  Below are some the sites I have developed previously.

www.hiscox.de

business.hiscox.co.uk

www.insurex.co.uk

 www.glynoldboys.com

www.hiscox.fr

www.ontheblog.net

 

Comments (0)

Print  
Tweets Minimize
Twitter / LordHanson
  1. LordHanson: Flash on iPad....nice. http://www.tipb.com/2010/07/04/frash-android-flash-ported-ipad/

    Published Sun, 04 Jul 2010 22:07:55 +0000 by
  2. LordHanson: Anyone noticed that when typing on your iPhone it sounds like your holding a gieger counter?

    Published Sun, 04 Jul 2010 22:05:28 +0000 by
  3. LordHanson: Missing wacko's music... What's happened to the album he was working on before he died?

    Published Fri, 25 Jun 2010 23:01:45 +0000 by
  4. LordHanson: New version of Connectify cannot recognise my active Internet connection! Had to roll back to previous version! #fail

    Published Fri, 25 Jun 2010 22:54:54 +0000 by
  5. LordHanson: vuvuzela blowing spoils the world cup! Fact!

    Published Mon, 14 Jun 2010 05:08:43 +0000 by
  6. LordHanson: About http://www.theaustralian.com.au/business/news/us-competition-regulators-to-investigate-apple/story-e6frg90x-1225878779986

    Published Mon, 14 Jun 2010 00:04:45 +0000 by
  7. LordHanson: In the camper van and a storm is coming.....How exciting.

    Published Sun, 25 Apr 2010 04:39:48 +0000 by
  8. LordHanson: My vaio p is doing well while travelling. 3g Internet, HD movies, digital tv, photo editing, wifi router for iPods and much more. Love it

    Published Wed, 10 Mar 2010 10:29:19 +0000 by
  9. LordHanson: Ok so I need to stay techie while away from a computer for a year. Anyone got any ideas.

    Published Mon, 22 Feb 2010 12:31:09 +0000 by
  10. LordHanson: Sitting in YHA Glebe Sydney waiting for the movie night to start

    Published Thu, 18 Feb 2010 08:13:10 +0000 by
  11. LordHanson: I finished work today in prep for travelling. I must admit as i left the office i felt a little emotional. Sign of a good job with great ...

    Published Tue, 26 Jan 2010 17:48:49 +0000 by
  12. LordHanson: Lots of sick sounding people creeping onto the trains today. Stay away stay away!

    Published Fri, 22 Jan 2010 08:14:36 +0000 by
  13. LordHanson: LMAO RT @colmbrophy: so have you seen who owns http://wwwbing.com ? it's not microsoft

    Published Tue, 19 Jan 2010 17:35:43 +0000 by
  14. LordHanson: RT @TeemuHyn: RT @eldarmurtazin: Hate Windows Mobile 7. No apps from previous versions of WM working here. Not compatible at all.

    Published Sun, 17 Jan 2010 19:01:29 +0000 by
  15. LordHanson: The girlfriend has gone all science on me.... She has her head in books about quasars!

    Published Sat, 16 Jan 2010 16:38:58 +0000 by
  16. LordHanson: New blog post: Invoking generic methods with Expression.Call http://bit.ly/5g99Ih

    Published Sat, 16 Jan 2010 16:34:00 +0000 by
  17. LordHanson: Found a nice way to invoke generic methods using expression trees and importantly avoiding Type.Getmethods() which you normally have to do!

    Published Fri, 15 Jan 2010 18:55:38 +0000 by
  18. LordHanson: Tried a dummy run of packing my backpack last night. Just managed to get it all in. The sleeping bag takes half the space. Not good.

    Published Fri, 15 Jan 2010 08:28:47 +0000 by
  19. LordHanson: Why do we get headaches for no apparent reason?

    Published Tue, 12 Jan 2010 15:28:29 +0000 by
  20. LordHanson: @swhelband beer time my friend

    Published Sun, 10 Jan 2010 21:49:44 +0000 by
Print  
Archive Minimize
Print  
Contact me Minimize
Print  
Microsoft Certs Minimize







Print  
Silverlight News Minimize
Silverlight - Google News
  1. Top 10 Things I Wish I Knew Before I Started My Silverlight 4 Project - Redmond Developer News

    Published Thu, 29 Jul 2010 23:21:01 GMT+00:00 by
  2. Microsoft's Flash challenger Silverlight hits Symbian - Register

    Published Tue, 06 Jul 2010 18:54:39 GMT+00:00 by
  3. Windows Phone 7 misses big-business support tools - Register

    Published Mon, 26 Jul 2010 20:32:23 GMT+00:00 by
  4. Neustar Reports Q2 Results, Stock Repurchase - TMCnet

    Published Fri, 30 Jul 2010 13:13:57 GMT+00:00 by
  5. Intertainment begins commercial rollout of Ad Taffy - PR Newswire (press release)

    Published Fri, 30 Jul 2010 14:19:22 GMT+00:00 by
  6. Download Microsoft Expression Studio Ultimate 4.0.20525.0 Free Trial / Full ... - Soft Sailor (blog)

    Published Fri, 30 Jul 2010 08:50:54 GMT+00:00 by
  7. Managing change in the application portfolio - Register

    Published Thu, 29 Jul 2010 09:36:57 GMT+00:00 by
  8. Queen Victoria in Liverpool panoramic picture - Liverpool Echo

    Published Mon, 26 Jul 2010 11:56:30 GMT+00:00 by
  9. AEBN's Silverlight Player Gains Traction with Users - AVN News (press release)

    Published Tue, 27 Jul 2010 20:28:37 GMT+00:00 by
  10. Written by David Conrad - iProgrammer

    Published Tue, 27 Jul 2010 12:39:37 GMT+00:00 by
Print