views:

12

answers:

0

I have a window Icon property set as :

Icon="..\..\Images\Project_32.png"

The build action is Resource, the png is included in my VS Studio project, and it works fine since that is the png's relative location from this window.

In Adam Nathan's WPF Unleashed (what a great book!), he states that "if you put [the image] in an images folder in your VS project (using or you can access it as:

Icon="Images\Project_32.png"

regardless of whether [the image] physically resides in an images subfolder at runtime, or if it's simply embedded in the assembly."

I believe Adam, and I would like to avoid hard coding the relative path, but I can't figure out where the bit goes to make it work. Is this some MS build type of statement? Am I missing something else? Would this work if the image was in a different project?

Cheers,
Berryl