How to access or share resource dictionary between MAUI application and library
I have a ContentPage in a MAUI library which is referring to a color defined in the resources of the App.xaml which is in the main MAUI project.
ContentPage in Library uses: BackgroundColor="{StaticResource White2}"
App.xaml in the MAUI application project defines: <Color x:Key="White2">#FFFFFF</Color>
On running the application there is a runtime error: Cannot fing resource White2.
How do i access(share) the resource dictionary declared in the App.xaml to a MAUI library project?
I tried the AI assisted solution, but Application.Current is null in the constructor of the ContentPage
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more