Search code examples
c#mauiresx

.NET MAUI choose different resource file depending on project


I have a project where I have a "base project" with resources as fallback files. And I have multiple "branded apps" with the same view as XAML files but with some resources that should override the fallback files.

The views are currently located in my base project.

How can I tell my view that it should prefer the resource from the "branded app" instead of the base project? Sadly, it is not allowed to move the views from the base project to the "branded apps".

I did already tried to load the resource with GetEntryAssembly() but I get a null return there, so no reference on the main project.

Sadly I have no idea where to start so I could need some help.

Project Sample


Solution

  • I thinki am going with the answer from Jason and use a pre-build script that adds the appropriate images and icons to each project before the build starts.