Categories
.NET Fireworks Silverlight WPF XAML

Fireworks to XAML Panel Updates (CS4 + Silverlight Fixes)

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)
Additional Notes
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.
Download Latest Version

9 replies on “Fireworks to XAML Panel Updates (CS4 + Silverlight Fixes)”

Wow! From a front end guy – to all you guys… how well does this work? I’m yet to get into xaml and it’s associated toolset – does this do what it says?

Nice work Grant! Now I might be able to use my skills in Fireworks and put them to good use!

Brendan

This version doesnt work with CS4 and Silverlight 2. The converter is using Grids, but grids arent supported in SL2 🙁

Hi Peter – Silverlight 2 does support the Grid panel (as well as Canvas and Border). It’s Silverlight 1 that only includes the Canvas panel. Perhaps you’re accidentally working on a Silverlight 1 project by mistake?

Grant:

Great stuff, but please!! save us a lot of time and frustration and inform users that they MUST run the extension manager as administrator on Vista, or the extensions will only look as if it installed, and they will search the Windows menu in Fireworks in vain (as you may have guessed that I have been doing for the past two hours).

Thanks.

Grant:

Great work. One problem – the TextBlock does not have its Name property written out if it is specified in the FW properties panel. Seems to work ok with other elements.

Hi Bruce — I’ll have a dedicated page set up for the exporter soon that calls this out — you’re definitely not the first to have encountered this problem (me included).

[…] to the workflow options we already have. Joanna Mason (who I also pestered about a fireworks import like Grants ) did a great presentation at mix showing off the complete flow from Adobe CS to full blown […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.