0

I'm using .NET Maui and I defined a static resource in Colors.xaml file, like so:

<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary 
   xmlns="http://schemas.microsoft.com/dotnet/2021/maui"   
   xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
   <Color x:Key="Primary">#47D1C1</Color>
</ResourceDictionary>

Now I want to bind it in colors.xml file defined for Android platform. How can I do it? Here is the Android colors.xml file:

    <?xml version="1.0" encoding="utf-8"?>
<resources>
   <color name="colorPrimary"> here I want to bind Primary resource </color>
   <color name="colorPrimaryDark">??</color>
   <color name="colorAccent">??</color>
</resources>
1
  • It is XML file. XML... Commented May 19, 2023 at 10:01

1 Answer 1

0

They are two different xml files for the different platforms. They can not bind the data from each other. If you want to Theme an app you can use the ResourceDictionary.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.