So firing up Expression Blend and getting into the whole WPF thing is always a refreshing change, especially getting away from mundane coding and alike. However, the first thing to trip me up and my colleague up was using the "Edit Externally" command from the project view to edit an existing '.png' file and whipping into my favourite graphics editor. Imagine my surprise when I was greeted with MSPaint! How there are two things to consider here...
- I used to be a design guy prior to becoming a programmer, so MSPaint is the last thing I need to see.
- Two - MSPaint is in no way anything like a sophisticated design application. Just get used to it ;-)
Now the doomsayers and conspiracy freaks might consider that MS has done this on purpose, so I fired up Reflector to work out how the project items (such as image files) were actually being catagorised and executed. What Blend does is by using the old .NET standby of Process.Start but explicitly passing through the 'Edit' string as the 'Verb' when making the call. In short, they're letting explorer handle the file association. Note: this works differently from explorer where if you double-click an existing and recognised dot extension it fires up the application with the selected file because its using the 'Open' verb and not the 'Edit' verb.
Ideally, Blend should use the 'Open' verb rather than hardcoding the 'Edit' verb (well, selection that is then implemented in the EditExternalCommand object) into the 'DocumentType.PreferredExternalEditCommand' property. Or even better - allow the user to specify those application they want for editing resources. But hey, its version 1.
So to get around this, a quick registry tweak will get things working. Navigate to the key...
HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit\command
...and change the value of the '(Default)' value to your favourite package from...
"%systemroot%\system32\mspaint.exe" "%1"
...to , so in my case to Fireworks...
"C:\Program Files\Macromedia\Fireworks 8\Fireworks.exe" "%1"
...and job done + no need restart...
HTH - And remember this fix / hack comes without warranty and will effect other instances where applications use this key as well. In short, be careful and backup your registry before doing this.