I have a solution under which so many WPF applications and class library projects are there. I want to use icon in another project which is under Resources folder in other WPF application. how can I achieve this ? I do not want to copy same images over and over in all different projects.
2 Answers
Use pack URI syntax to refer resources. Somethning like this:
<Image Source="pack://application:,,,/Another.Assembly.Name;component/PathToResourceInAnotherProject/YourImage.png"/> Comments
Yes,Microsoft makes that possible for you, as long as Project ABC has a reference to Project XYZ.
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Project XYZ;component/YourSubFolder/YourResourceFile.xaml" /> </ResourceDictionary.MergedDictionaries> Then you can just use the Resources defined in YourResourceFile.xaml.
3 Comments
Dirty Developer
It works as per your suggestion! I want to try something more and let you know what I want to achieve is possible or not
Carbine
Shouldn't it be
/Project XYZ; as per your above statementDirty Developer
Well it should be but I understand the what he wants to tell me :)