DependencyProperties the easier way

After working with Workflow Foundation at a customer I had to admit: I hate DependencyProperties. Yes I hate them. They exist because Workflow Foundation, Windows Presentation Foundation and now also Silverlight needed some way to add features to properties. I must admit I would have liked a different approach by using some kind of Aspect Orientation with PostSharp or so. But I still have to make use of them, so let's make the creation of DependencyProperties easier, an Resharper Live Template. Just a few words (Property Name, Property Type, Activity Type and PropertyDescription) and you'll have a full DependencyProperty. I made the Live Template start with word "dprop" and also made the Activity Type be selected by the containing class type.

1 public static DependencyProperty $PROPERTYNAME$Property = 2 DependencyProperty.Register("$PROPERTYNAME$", typeof ($PROPERTYTYPE$), 3 typeof ($ACTIVITYTYPE$)); 4 [Description("$PROPERTYDESCRIPTION$")] 5 [Browsable(true)] 6 [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] 7 public $PROPERTYTYPE$ $PROPERTYNAME$ 8 { 9 get { return ($PROPERTYTYPE$) GetValue($PROPERTYNAME$Property); } 10 set { SetValue($PROPERTYNAME$Property, value); } 11 }

Have fun with it.

Create a custom Launchy clone?

I just came across a three part article about creating a custom Launchy clone in .NET and WPF. Launchy is very nice application launcher I talked about in the past. The article is very detailed, I like it. And for all Launchy is very feature-rich, but I only use it for launching applications that are in my Start menu. Take a look at it for yourself. Maybe I build my own Launchy clone. A good start to get to know WPF a little better, practice the Model View Presenter pattern and more.

My view about the overview of Microsoft Visual Studio 2008

Microsoft published a white paper about Microsoft Visual Studio 2008. I read it and discuss it in a brief summary. The white paper discuss the different customer experiences that Visual Studio 2008 delivers through seven different technology areas.

  1. Develop Smart Client Applications
  2. Create Microsoft Office Applications
  3. Build Windows Vista Applications
  4. Handle Data More Productive
  5. An Improved Developer Experience Overall
  6. Enable New Web Experiences
  7. Improve Application Life-cycle Management (ALM)

1: Develop Smart Client Applications

The ClickOnce application deployment is improved. Firefox is supported as a browser, very nice and necessary for ClickOnce becoming successful.

Something I'm not really sure about. Office 2007 UI support for native C++ applications. Those native applications can make use of the Ribbon Bar, Ribbon Status Bar and Mini-toolbar. But why only support native C++ applications? We want this feature for managed C# applications, don't we?

Microsoft Synchronization Services for ADO.NET provides an API to synchronize between data services and the local data store. This could be nice, but I hope it's solid. In the past I sadly met Microsoft Access Replication, something comparable to the basics I think. I'll never suggest a company to use Microsoft Access Replication. But ADO.NET Synchronization Services might work, I guess we will have to wait for Real World Experience on this.

2: Create Microsoft Office Applications

No comments yet, maybe later.

3: Build Windows Vista Applications

Visual Studio now provides tools for Windows Presentation Foundation. We can now use a designer to create our user interface, in the past we needed to use Microsoft Expression Blend.

4: Handle Data More Productive

Also new is the Language Integrated Query (LINQ). It supports querying for objects, databases and XML. And if I'm right LINQ 2 SQL is some sort of ORM tool. I try to look more into this in the future.

5: An Improved Developer Experience Overall

You have the ability to target different .NET Framework platforms while making use of Visual Studio 2008. Very nice, I'm not sure how far this goes. Are you able to build against the .NET Framework 1.1 but are you able to make use of IntelliSense trough the other platforms? Are you able to make use of designers for the .NET Framework 1.1? Don't think so, but I have to check first.

6: Enable New Web Experiences

The new web experiences consists of the integration of a new version of AJAX ASP.NET and the integration of Windows Live Services. Besides this it should be easier to consume a Windows Communication Foundation service.

7: Improve Application Life-cycle Management (ALM)

The most interesting thing is the enhanced Visual Studio Unit Testing. The performance is improved, but I'm interested to see if it is extendable and be used better in conjunction with Mocking frameworks.

Service Oriented Architecture in the Real World

SOA in the Real World is a book that introduces a set of SOA capabilities and explores them. You can download this book for free from the Microsoft site. I think this is the ideal time for me to get to know SOA better and how it can be applied in the Real World.

Expression Blend 2 May Preview Installation Troubles

I thought it was time to start trying out some Windows Presentation Foundation (WPF). So I downloaded the latest VPC with Orcas CTP (June 2007) and Expression Blend 2 (May Preview). But starting the Expression Blend 2 setup gives an error about the .NET 3.0 framework that needs to be installed. After some research I found out .NET 3.0 SP1 is installed on the Orcas VPC. Some more research gives the following solution.

You can fool the Expression Blend 2 setup by changing a registry key. Follow the steps:

  • Search for the "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Presentation Foundation\ProductVersion" registry key
  • My original ProductVersion value is: 3.0.04506.577
  • I changed it to ProductVersion: 3.0.6913.0
  • I ran the Expression Blend 2 setup
  • And changed the ProductVersion back to: 3.0.04506.577

Now let's play with WPF.