开发者

Get relative path to image in another project in same solution

开发者 https://www.devze.com 2023-04-08 19:59 出处:网络
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.

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.

solu开发者_如何转开发tion

-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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消