XAML WPF canvas

You can save Microsoft Expression Design artwork as a XAML Windows Presentation Foundation (WPF) canvas document that you can add to a Windows Presentation Foundation project in Microsoft Expression Blend 2. A canvas document in a WPF project can be the startup XAML page of your project, or you can copy and paste objects from the exported canvas document into another document in your project, or you can convert your canvas objects into buttons or customizable user controls.

You can export to a XAML WPF canvas in the following ways:

  • Export the whole Expression Design document as a single XAML WPF canvas document.

  • Export selected objects as a single XAML WPF canvas document.

  • Export one or more slices of your artwork as individual XAML WPF canvas documents.

  • Export one or more slices of your artwork as individual XAML WPF canvas objects in a single XAML WPF canvas document (container).

  • Export one or more slices of your artwork as individual images in a XAML WPF canvas document (container). This option creates a single XAML WPF canvas document that contains Image objects for each slice. The image files are exported in a subfolder in the same directory as your exported XAML WPF canvas document.

Note

Colors in your exported XAML code are based on RGB and are not color managed. If you use a custom color monitor profile, the colors you see in Expression Design may differ from those displayed in your final XAML-editing software.

Note

Some text properties are not supported by Silverlight 1.0. For more information, see XAML text support.

Exporting your artwork as a XAML WPF canvas

To export art as a XAML WPF canvas document

  1. On the File menu, click Export. The Export dialog box displays your artwork in a preview window.

  2. Under Items to Export, select one of the following options:

    • Whole document   Select this option to automatically export all the artwork in your Expression Design document as single WPF canvas document.

    • Selected objects   Select this option to export only those objects that you selected before you opened the Export dialog box. The objects will be exported as a single WPF canvas document.

    • Slices   Select this option to export slices of your artwork, in multiple output files and formats. Slices are configured before you open the Export dialog box. The preview window changes to display each slice individually so that you can select different export settings for each. You can also use the Slice contents drop-down box to show or hide objects in the slice. For more information, see Slices.

  3. In the Export dialog box, in the Format list, select one of the following:

    • XAML WPF Canvas   Select this option if you are exporting the whole document or selected objects as a single XAML WPF canvas document.

    • PNG, JPEG, GIF, TIFF, BMP, or XAML WPF Canvas   If you are exporting slices, select one of these options for each slice. You can set the Format property for multiple slices by using the SHIFT key to select multiple slices before you set the Format property.

      Note

      Expression Design does not assume that you want to export each slice using the same format.

      You can then select the XAML WPF Canvas container from the list next to Container name, and type a name for your XAML WPF canvas document in the Container name text box. If you do not select a container, each slice will be exported in a separate file according to its Format property.

  4. Adjust the following settings:

    Note

    If you are exporting slices as XAML WPF canvas objects, you must set these properties on each slice.

    • Always name objects   Select this check box to name all objects that are converted from your artwork. This does not include the final canvas container.

    • Placed grouped objects in a XAML layout container   Select this check box to wrap grouped objects in your Expression Design document in individual XAML layout containers, such as canvas objects.

    • Editable TextBlock   Select this option to convert text to TextBlock objects that will be editable after you import the document into Expression Blend 2.

    • Paths   Select this option to convert all text to Path objects.

    • Rasterize all   Select this option to rasterize (convert into bitmapped images) any live effects that are applied to your artwork. This option helps maintain the appearance of your artwork as much as it can.

    • Convert to XAML effects   Select this option to convert any live effects to XAML-supported effects. Live effects that are not supported in XAML are rasterized.

  5. Next to File name, enter a name for your XAML WPF canvas document.

    Note

    The File name field is not present if you are exporting slices because the names of the slices are used as the file names for the exported canvas objects.

  6. Next to Location, browse to or enter the path for the location where you want the output file to be saved.

  7. Click Export All to export the file or files. If you are exporting slices and you want to export only some of them, you can select multiple slices in the preview window (hold the SHIFT key), click the drop-down arrow next to Export All, and then click Export Selected Slice(s). Alternatively, if you want to save any changes that you made to the export properties for individual slices without actually exporting the slices, click the drop-down arrow next to Export All and select Save Settings and Close.

    Your XAML WPF canvas document is exported to the path that you specified in the Location property, together with any supporting artwork in a subfolder named <resource_name>_files. When you add the exported document to a WPF project in Expression Blend 2, Expression Blend automatically imports the <resource_name>_files folder also.

The Export dialog box set to export a whole Expression Design document as a single XAML WPF canvas document, without converting the text to path objects

Cc294753.ed57097a-5714-42b5-9a54-63dd879c1838(en-us,Expression.10).png

Importing your XAML WPF canvas into an Expression Blend project

To import your XAML WPF canvas into an Expression Blend project

  1. In an open WPF project in Expression Blend 2, click Add Existing Item on the Project menu.

  2. In the Add Existing Item dialog box, browse to your exported XAML WPF canvas file, select it, and then click Open. The file is added under Files in the Project panel. If the document includes exported image files in a <resource_name>_files folder, that folder is imported also.

  3. Under Files in the Project panel, double-click the file name to open the document. You can copy and paste objects from your imported canvas document into the starting XAML document for your WPF project, or you can right-click the document name under Files, and then select Startup to make your imported canvas document the startup document for your WPF application.

    For information about how to convert your canvas objects into buttons or user controls, see the "Make an object into a button" and "Create a control from existing objects" topics in the Expression Blend 2 User Guide.

    Tip

    Make sure that the names of your objects differ from other objects in your Expression Blend 2 project. If naming conflicts occur, they will be listed in the Results panel (press F12 if you do not see the Results panel). Double-click an error to be taken to that line of XAML so that you can change the object's name.

See also

Concepts

Print and Export options

Document size

Live effects

Slices

Export a slice

Bitmapped images