UPDATE: Click Here for the Latest Version
If you’re using Fireworks CS4 and the Fireworks to XAML Exporter, chances are you’ve seen a problem with the quotation marks in the rendered XAML. I first saw this several months ago, but assumed it was just an issue with a beta version of Blend I was using at the time. As it turns out, changes to the core Fireworks text rendering engine were actually causing the problem – a result of the way I was copying text to the clipboard.
The original version of the panel creates a Fireworks text block, pastes the generated XAML inside the text block, then does a clipCut() to remove the text block from the stage and copy it to the clipboard. The latest version (posted here), sends the XAML back to the Flash panel and, using the System.setClipboard() method, pastes the XAML to the clipboard. The result is a noticeably faster export operation, a very nice surprise.
I’ve also done a little additional housecleaning, adding support for the new pixel-based rounded corners feature of Fireworks CS4. This is actually one of my favorite new features — where previously the CornerRadius of rectangles in Fireworks was percentage-based (meaning the amount of roundness would change as you resized the rectangle) you can now specify a pixel-based CornerRadius. This approach ensures the same CornerRadius regardless of the size of the rectangle. (This is how both WPF and Silverlight do it also). The updated panel will honor both percentage and pixel-based roundness modes.
I also updated the way text is converted to paths. Now, instead of a group of individual path objects (the result you get when you select Text > Convert to Paths in Fireworks, I go two steps further, first ungrouping the indivual paths, then joining them into a single path. The result is a much cleaner single Path object.
One last fix I made over the weekend addresses a problem exposed by Silverlight. The FW to XAML panel automatically adds a .Resources collection to the outermost panel, should any of its children need to define a brush resource. Often, this Resources collection was rendered as an empty node <Grid.Resources />, something that the Silverlight engine does not like (WPF just ignores it). So, this latest update removes the Resources node if it’s empty. You’re welcome!
Summary of Changes
- New Clipboard Logic – supports Fireworks CS4, improved performance
- Support for both percentage and pixel-based rectangle roundness modes (pixel-based mode introduced with FW CS4)
- Text to Paths operation results in fewer XAML objects
- No longer render empty Resources collection (exposed via Silverlight)
As always, you’re guinea pigs. Please let me know if you run into any problems with this update. I have run it through my standard gauntlet of tests, but I may have missed a use case.