Relative imagesources

I have 2 questions regarding relative Uris

First question: Why doesn't this work?

<ImageSource="test.jpg" />

<ImageSource="E:\Documents and Settings\Administrator\Mina dokument\Visual Studio 2005\Projects\testimage\testimage\bin\Debug\test.jpg" />

The first image is not displayed but the second works fine. (the exe is located in the debug-directory)

Second question:

If i have a program that dynamicly loads an xaml-file at runtime located at APPDIR\skins\myskin\data.xaml

In this xaml-file there is an Image, will the source on this Image be relative to the main exe or to that xaml-file.

Is it the same for xaml-files compiled into the main program assembly?

[1865 byte] By [Chimme] at [2007-12-23]
# 1
All relative references map to application resources and content files, not to arbitrary files on disk. You need to declare the file in your project as Content or Resource in order for WPF to recognize it. Fully qualified paths/URIs may work, depending on the location and the app's zone of deployment. See this article for details.
AshishShetty-MSFT at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2
I was able to load an image within my application using just the relative path <Image Source="Images\pic.jpg"/> I'm not sure why it wouldn't work for you.
ivolved_Mike_Brown at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified