Posts for Category: Tools

Converting SVG to XAML - XamlTune vs. Ab2d SVG to Xaml Converter

I've mentioned before my fondness of using SVG content and converting it to XAML. Today I read about the Visio to XAML converter on Saveen's blog and about the approach taken (saving to SVG and then using a third party library XamlTune to convert to XAML). I was fairly interested in reading about this approach because I had tried this myself before (not as an add-in, just saving Visio to SVG and then manually converting) with very limited success.

After a few tests I'm very impressed with XamlTune, and recommend you try it if you need to convert from SVG to XAML. For comparison here is the original SVG file that inspired my glossy radial brushes previously.

original SVG

Here is the output from XamlTune (using the default settings)

XamlTune output

And here is the output from Ab2d SVG Reader (once again, using the default settings)

Ab2d SVG output

posted on 2/15/2008 11:35:10 PM


WPF-specific Snippets in Visual Studio 2008

Visual Studio 2008 comes with some useful snippets for WPF development out of the box. In C# type propa followed by two TAB keystrokes inserts the a snippet for an attached dependency property, including a getter, setter and the registration code.

Similarly propdp followed by two TAB keystrokes inserts a snippet for a dependency property. As you would expect the snippet for this is very similar to the attached dependency property, except in this case it calls DependencyProperty.Register() instead of DependencyProperty.RegisterAttached().

The C# snippet in action

Visual Basic in Visual Studio 2008 has even more snippets defined including RoutedCommand and RoutedEvent registration snippets, and a RoutedCommand handler snippet. I'm primarily a C# kind of guy, so I never realized that VB.NET had the two snippets I mentioned above for C# in VS2005 (with the VS Extensions for .NET 3.0 installed). It seems in this case C# is playing catch-up to VB.NET.

You can look at all the snippets (not just the WPF-specific ones) by selecting "Tools->Code Snippet Manager" from the VS menu. You can of course define your own snippets, but it is nice to see these ones built in to VS2008.

posted on 11/30/2007 11:41:57 PM


Visual Studio 2008 and .NET Framework 3.5 Released

Visual Studio 2008 and .NET Framework 3.5 were released earlier this week. Visual Studio 2008 is the first version of Visual Studio released since WPF and the rest of .NET Framework 3.0 were released a year ago. VS2008 includes a WPF designer and XAML editor, and allows targeting of .NET 3.0 or .NET 3.5 when developing and compiling solutions.

.NET Framework 3.5 includes a host of new language features for C# 3.0 and VB9. Most of these language features exist primarily to support LINQ, however .NET 3.5 also includes some enhancements to WPF. An overview of the changes in 3.5 can be found here on MSDN. Kevin Moore also recorded an interview for Channel9 before he left Microsoft discussing some of the changes that were coming in 3.5. Dr Tim Sneath also listed off 15 of his favourite enhancements to WPF here.

Some of my favourite enhancements for WPF in .NET 3.5 are supporting XBAP applications in FireFox (on versions of Windows) and the data binding and IErrorProvider enhancements (thanks in part to Paul Stovell). 

posted on 11/25/2007 1:14:25 PM


Free Vector Images for your WPF Projects

If you're from further down the developer end of the designer-developer spectrum chances are you've been avoiding creating your own images, and on the look-out for some good XAML icons and vector images to include in your application, since bitmap images often look blurry. While we included some XAML image resources in the past there are plenty of other good resources out on the web if you know what to look for. Although no graphic designers are sitting at home churning out XAML code per-se, there are plenty of ways to convert the vector content they produce (like SVG files or Adobe Illustrator .ai files) to XAML.  Here we've included two sites to get you started, and approaches for converting other vector formats into XAML.

OpenClipArt.org is a repository of "open source" vector art stored in SVG format. SVG is an XML-based vector format (and thus you could transform it yourself to XAML if you wished), however there is already an excellent tool from Andrej Benedik from WPF-graphics.com for doing this. You can also use the free and open-source InkScape editor to edit SVG files. Many of the images are licensed in the public domain, meaning you can use them for pretty much any purpose. Shown below is a mac-like SVG image of a new computer by "big red smile" (possibly not their real name)  beside the converted XAML version displayed in Kaxaml.

vecteezy.com is a "free vector art of the day" type site, with nice vector backgrounds and images released under a variety of terms (so make sure you check the license on the image). Most of the files here are Adobe Illustrator .ai files. If you have Illustrator installed you can use Mike Swanson's exporter, however if you're a developer that is less likely. Expression Design (now included in MSDN universal) can import Illustrator .ai files. For some reason it can't open them directly (if you select File->Open and then try to browse for a .ai file it won't let you) so you need to create a new blank file, and then select File->Import and browse for the .au file. Once in Expression Design you select File->Export and select Xaml as the type from the dropdown list. You can then choose how the xaml is formed when you export it.

posted on 9/12/2007 11:37:27 PM


Visual Studio 2008 Beta 2, Sliverlight Tools for VS2008 and Expression Blend 2.0 August Preview

This week was a big one in the WPF tools space, following the release of Visual Studio 2008 Beta 2 (in Express, Standard and Pro editions for which you need to download the secure content downloader), the Silverlight tools for Visual Sudio 2008 and Expression Blend 2 August Preview (which features a number of new silverlight-specific features).

The Visual Studio 2008 cider designer is much improved from beta 1 - it remembers your settings for each file, crashes less often and is able to render your xaml files more frequently (if this sounds like faint praise - it is). It also has some nice xaml-editing improvements, such as the xaml-specific intellisense shown below, to help write those pesky CLR namespace to XML namespace mappings.
Visual Studio 2008 XAML-specific intellisense

posted on 7/29/2007 9:31:51 PM


Assembling a Free WPF Development Toolset

Want to get started playing around with WPF applications, but you'd rather save your cash for some SLI video cards? Never fear - we've assembled a list of free (as in gratis) tools for most facets of WPF development.

Essentials

Visual Studio Express Editions (C#/VB.NET)  and Visual Studio Extensions for .NET 3.0  will get you up and running and building "hello world".

Optional - Development

Microsoft Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components - this SDK includes a number of samples, tools and documentation that can be very helpful when developing WPF applications.

Optional - Design

Inkscape is an open-source vector graphics editor. It is ideal for creating vector icons, complex paths, geometries and the like. It's native file format is SVG, an XML dialect for representing vector graphics. In order to incorporate Inkscape into your WPF tool-chain you'll need this handy SVG to XAML converter, written by Andrej Benedik from wpf-graphics.com.

Optional - 3D

Blender is the free open source 3D content creation suite. You can use it to develop 3D content, which you then export to XAML using this export script from Daniel Lehenbauer from the WPF 3D team at MS. Note - the latest release of Blender seems to have some issues running on Vista. Also, to run the export script you will need to install Python.

Optional - Components

Xceed DataGrid for WPF is a free, commercial-quality data grid offered by Xceed. WPF does not include a datagrid as one of the build-in controls, and Xceed has more than filled this gap with their grid. You can also catch an interview with Pascal Bourque, one of the senior developers from Xceed on Channel9, talking about the new approaches and opportunities for developing components for WPF.

posted on 7/6/2007 3:41:19 AM


Xaml Decompiler from Lutz Roeder

Lutz Roeder, author of the popular .NET class browser and decompiler reflector has released a Xaml disassembler. Xaml (used for defining UI layout and vector graphics in WPF applications) is typically "compiled" into a more efficient binary representation called Baml and embedded as a resource in WPF applications where it is read at run-time. Lutz' tool reverses this "compilation" process, returning Xaml which is much easier to understand than Baml, but also easier to copy. Lutz Roeder is a Microsoft employee has been a member of the Expression Blend (formerly Expression Interactive Designer, formerly Sparkle) team since 2002.

I performed some tests disassembling/decompiling non-trivial Baml from a few applications (some of which I had the source-code and some which I did not) and was impressed by the accuracy of the output. More details on using the BamlDecompiler utility can be found here. In addition to being able to disassemble Baml from WPF applications it is also useful for looking at the default control styles for the different windows themes. Although there are a number of classes in the System.Windows.Markup namespace (part of WPF and .NET3) that read Baml at run-time (for creating object instances) it seems that Lutz has had to do a fair bit of "heavy lifting" himself inside the BamlDecompiler class in which makes up the vast majority of the tool. No doubt this will become essential for analysing WPF code and 3rd-party libraries.

posted on 1/31/2007 12:18:40 AM


Expression Blend Beta 1 and Design Dec CTP Released

New versions of Microsoft's two forthcoming WPF-centric "designer" producst from the expression range were relesed yesterday. Expression Blend (formerly known as Expression Interactive Designer, formerly known as Sparkle) is a Xaml design tool focused towards graphic and interaction designers. Yesterday's release is the first beta version of this product. Expression Design (formerly known as Acrylic) is a graphic design tool for creating vector and bitmap assets. It is primarily of interest to WPF aficionados due to its Xaml export capabilities. This is the December CTP of Expression Design.

posted on 12/6/2006 7:35:26 AM


How do I create WPF graphics using the Expression Graphic Designer?

The Expression Graphic Designer (code-named Acrylic) is capable of saving out assets to Xaml using the File > Export > Xaml Export from the main menu. The assets can be exported as elements in a canvas, or as a resource (suitable for embedding in your application).

Exporting graphics from Acrylic to Xaml format

 Unfortunately unlike the Expression Interactive Designer (code-named Sparkle) Xaml is not the "native format" of Acrylic, so the export process is one-way. The representation in Xaml is quite good however, even for assets that contain both vector and raster (bitmap) layers.

Exported graphic displayed in IE window

The March CTP of the Expression Graphic Designer can be downloaded from here.

posted on 3/13/2006 10:07:16 PM


Expression Interactive Designer March CTP Available

The March CTP of the Expression Interactive Designer has been released. It is built against the February CTP of WinFx. You can download the March CTP of the Expression Interactive Designer here. The Expression Interactive Designer (code-named Sparkle) is a design tool for creating WPF interfaces, and allows you to create UI without having to know Xaml syntax. Also of interest to WPF developers, the Expression Interactive Designer was written in WPF. It was announced at PDC 2005, and the first publicly available version was the January CTP. You can read more about this latest release here on the Expression weblog.

posted on 3/11/2006 6:08:31 PM