I want to load image from an directory under my executable location.
<ImageBrush x:Key="WindowBackground" ImageSource="./backgrounds/Zenitsu.png" Stretch="UniformToFill"/>
I have tried to use ./backgrounds/
or \backgrounds\
but both seems like finding result in project directly instead or executables's location.
My output structure is like this:
Main.exe
----backgrounds
--------Zenitsu.png
You could create a converter such as:
And use it as follows:
If the images will not change you might prefer to include them as embedded resources: How to reference image resources in XAML?