I'm trying to set the background of a dock panel in my WPF application. Originally I had the full path hard coded in the image source attribute, but realise this is not best practice.
I set up an images folder in my project, and added the background image there. The directory looks like:
Solution:
-Resources
-Background.png
-Project
-bin
-obj
-properties
How can I set the background with this setup? At the moment I have this, which doesn't give me an error before running, but then throws an exception when I do.
<DockPanel.Background>
<ImageBrush ImageSource= "..\Resources\background.png"/>
</DockPanel.Background>
Thanks