views:

57

answers:

0

I have a XAML file representing a 3D model with textures.

I want to make the textures read from the same place the file is, or relative to it.

I read the file using a XamlReader, so I want the file to be self-contained.

I place the textures using an ImageBrush which ImageSource is a pack synatx URI.

When I use a 'siteoforigin' syntax, this only works if the texture file is next to the application. I want it to be next to the Xaml, wherever it is.

I tried setting the current directory to the Xaml directory, but it didn't help.

Not using a pack syntax doesn't work as well - it just look for a resource by that name.

How do I need to write the Xaml image source (or is there another way to place textures for a diffuse material brush?) so it will work?

Itai.