tags:

views:

431

answers:

2

I'm using XamlWriter to serialize a group of WPF objects. One of these objects is an Image control whose Source is set to a file on disk.

When the XamlWriter serializes the objects, it sets the source image to an Uri that points to the file on the filesystem. Is there a way to include that data in the Xaml so that instead of referencing the file, the information is stored in xaml?

Thanks

A: 

From MSDN:
Serialization Limitations of XamlWriter.Save

"Images are also serialized as object references to images as they exist in the project, rather than as original source references, losing whatever filename or URI was originally referenced."

Giffyguy
A: 

Well, what I did in the end was build a wrapper class that used a binary serializer to store the images and the xaml code from the XamlWriter.

Kiranu