© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
Denis

Sharing PNG/SVG resources between WPF projects

I have a set of images that need to be displayed within my WPF Views.
Assuming I only need and have a single project, adding said resources to it, setting them to
Resource
Resource
in the properties, and then referencing via their respective paths is sufficient and works.
E.g.:
1. Create a WPF project
2. Add a folder called Resources
3. Place a PNG image into the Resources folder
4. Set the image item type to be
Resource
Resource

5. Reference the image via
pack://application:,,,/Resources/Color.png
pack://application:,,,/Resources/Color.png
or
/MyWPFProjectName;component/Resources/Image.png
/MyWPFProjectName;component/Resources/Image.png


Unfortunately, I'm failing to make it work with a multiple projects, where a one of them serves to share images, and the rest reference them (assuming I use a path like
/MySharedImageProject;component/Resources/Image.png
/MySharedImageProject;component/Resources/Image.png
).
I'd prefer to have a system similar to how DevExpress does it via a
MarkupExtension
MarkupExtension
: https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.DXImageExtension#remarks

Any pointers you could give me on how to share image resources between projects?
DXImageExtension Class | WPF Controls | DevExpress Documentation
Developer documentation for all DevExpress products.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Svg to png conversion
C#CC# / help
13mo ago
SVG Icon in a wpf App
C#CC# / help
11mo ago
[WPF] Svg changing fill during runtime.
C#CC# / help
15mo ago
Referencing between Two Projects
C#CC# / help
3y ago