Introduction
So, let's say I build some Application for a client, this application cointans several images, like a logo, several buttons in copropate design, which I want my clients to change freely without having to rebuild the project every time.
Problem
So, I put it into my "image" Folder in my Solution
And set it like this:
<Image Source="/images/SaveButtonpicture.png" />
Now the logo is located at
MyProject/Images
and either gets packed into the assembly, if set to "Resource" or gets copied to
MyProject/bin/Debug/Images
if set as "Content" with "copy to output directory" is set to "Always"
I don't like the image folder to be at this place. I'd much rather have my logo in
MyProject/bin/Debug/Assets/Images/Logos/
I already worked out a pre-build event to move all logos to there, but I don't know how to create a non static path.
using <Image Source="pack://application:,,,/images/Logo.png" />
would navigate from the solution folder, but that won't work anymore once I hand out the completed version.
Is there an xaml equivalent to System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)
, that'll return the folder of my executable simular to how pack://application:
navigates from the solution folder.
Question
I'd like to find a way to get the correct path without using any c# code