Deprecated: Assigning the return value of new by reference is deprecated in /home/iaciro/public_html/wp-includes/cache.php on line 36

Deprecated: Assigning the return value of new by reference is deprecated in /home/iaciro/public_html/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/iaciro/public_html/wp-includes/theme.php on line 508

Deprecated: Assigning the return value of new by reference is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 671

Warning: Cannot modify header information - headers already sent by (output started at /home/iaciro/public_html/wp-includes/cache.php:36) in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 639

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
SELECT COUNT(id) FROM wp_wassup WHERE timestamp<''


Deprecated: Function eregi() is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 720

Deprecated: Function eregi() is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 721

Deprecated: Function eregi() is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 722

Deprecated: Function eregi() is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 725

Deprecated: Function eregi() is deprecated in /home/iaciro/public_html/wp-content/plugins/wassup/wassup.php on line 726

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
SHOW COLUMNS FROM wp_wassup LIKE 'username'

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
ALTER TABLE wp_wassup ADD COLUMN username VARCHAR( 50 ) NULL

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
SHOW COLUMNS FROM wp_wassup LIKE 'comment_author'

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
ALTER TABLE wp_wassup ADD COLUMN comment_author VARCHAR( 50 ) NULL

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
show columns from wp_wassup LIKE 'referrer'

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
show columns from wp_wassup LIKE 'searchpage'

WordPress database error: [Table './iaciro_blogdb/wp_wassup' is marked as crashed and should be repaired]
INSERT INTO wp_wassup (wassup_id, timestamp, ip, hostname, urlrequested, agent, referrer, search, searchpage, os, browser, language, screen_res, searchengine, spider, feed, username, comment_author) VALUES ('71ca604c795658c69be93d6204eb2991','1511232789','54.145.117.60','ec2-54-145-117-60.compute-1.amazonaws.com','/2008/06/29/how-to-convert-anything-to-xaml/','CCBot/2.0 (http://commoncrawl.org/faq/)','', '', '', 'N/A N/A', 'N/A ', '', '', '', '', '', '', '')

Andrei Iacob / How to convert anything to XAML
Skip to content

How to convert anything to XAML

Ok, so when you’re working with WPF or Silverlight, all the graphics and/or interface elements are in XAML format (or should be, for getting the most out of these technologies).

Currently, Expression Design imports formats such as *.ai (Adobe Illustrator) and export it to XAML. Other graphic editing programs, both 2D and 3D have plugins for exporting to XAML. ZAM3D actually converts most 3D formats to XAML. There is actually a converter that exports XAML from SWF (yeah).

This post isn’t about these, it’s about XPS. The XML Paper Specification (XPS) is a standard for documents from Microsoft (kind of like PDF) that can be very useful for a WPF/Silverlight programmer. Let’s see how you can convert Word to XAML, Excel to XAML (don’t know why, but you never know) or Powerpoint to XAML.

I started PowerPoint and doodled something like in the image

Then, File->Save as-> PDF or XPS. If you don’t have the addon for this, you can download it from here. Only for genuine Office products. Chose XPS from the drop down, and then go to the file location.

Now, for the fun part. Change the xps extension to zip (sounds familiar?) and then unzip the archive. Now, in the folder where the archive was unpacked, you can see a document structure. In the path Documents\1\Pages, you can see an *.fpage file. Open it up.

It’s XAML. You can import it into every project that needs XAML. For example:

But as you can see, the XAML must be fine tuned by eliminating the root element that’s not supported by WPF (nor Silverlight).

But the title of this post is Hot to convert anything to XAML. What’s the catch? The catch is Microsoft XPS Document Writer which can be found in any program when trying to print something.

So, if there’s anything you want to be in XAML format, you can try to “print” (actually create) a XPS document with that contents, and check out the archive for the XAML. Well, the export isn’t always what you’d expect (the names of the elements are all generated, a lot of resources to add to the project, expected XAML paths are often images, etc.) but in most cases it surely beats creating the whole stuff from scratch using a XAML editor.

Cheers.

4 Comments

  1. john wrote:

    Bine ai revenit .

    Posted on 29-Jun-08 at 9:02 am | Permalink
  2. Andrei wrote:

    Mersi, Ionuţ

    Posted on 30-Jun-08 at 9:24 am | Permalink
  3. vineeth wrote:

    Hello

    iam using wpf application how can we convert the xaml file to svg

    or is it any way to save canvas as svg

    give a reply urgent

    Posted on 17-Oct-08 at 12:23 pm | Permalink
  4. Andrei wrote:

    “give a reply urgent”

    Is that some sort of “plz send the teh codez”?

    http://members.chello.nl/~a.degreef/xaml/xaml2svg.xsl

    Posted on 18-Oct-08 at 11:36 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*