Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get relative path to image in another project in same solution

I have a Silverlight project with several projects in my solution. I want to get a relative path to an image in project A from project B inside my helper C# class.

solution

-Project A

  -Helper.cs

-Project B

  -image.jpg

Helper.cs need a reference to image.jpg

I can't add a reference to prj A from prj B.

Can I do something like:

Uri uri = new Uri("/project.name.projectA;image.jpg", UriKind.Relative);

Thank you

like image 796
vikke Avatar asked Dec 28 '25 02:12

vikke


1 Answers

pack://application:,,,/ReferencedAssembly;component/ResourceFile.xaml

Replace ReferencedAssembly with the name of the referenced assembly and ResourceFile.xaml with the name of the file in it which has build type resource.

Resource File Pack URIs Referenced Assembly

like image 92
Muhammad Hasan Khan Avatar answered Dec 30 '25 16:12

Muhammad Hasan Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!