W
W
WS_Gleb_Sirius2021-05-05 11:38:02
WPF
WS_Gleb_Sirius, 2021-05-05 11:38:02

Wpf XAML Relative Paths?

My project in Visual Studio in C# programming language with WCF/WPF

has this solution:
60925814e80c3720425262.jpeg
The screenshot shows the Data folder, which contains the Images folder. How can I specify the relative path to the photo in XAML? Not
like now,
<Image Source="J:\ProgramData\TrainzCity\source\repos\WpfNavigate\WpfNumber2\Data\Images\Male.jpg" Margin="5" OpacityMask="Black"></Image>
but in
such a format.
<Image Source="%ФайлыПроекта%\Data\Images\Male.jpg" Margin="5" OpacityMask="Black"></Image>
Project Path:
J:\ProgramData\TrainzCity\source\repos\WpfNavigate\WpfNumber2\
relevant only on my PC, but I need the path to the photo to be correct on all PCs, since the photo is in the project folder.
How to achieve this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2021-05-06
@yarosroman

https://www.wpfsharp.com/2012/01/23/using-relative...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question