Hello,
Welcome to our Microsoft Q&A platform!
To specify a background color for the view, try using the data binding.
<StackLayout>
<Button:CustomButton BackgroundColor="{Binding TheBackground}"/>
</StackLayout>
Then detect the project name to set different values for the binding parameter.
var appName = AppInfo.Name;
switch (appName)
{
case "Proje1.Client1.Android":
TheBackground = Color.Red;
break;
case "Proje1.Client2.Android":
...
break;
case "Proje1.Client1.iOS":
...
break;
case "Proj1.Client2.iOS":
...
break;
default:
TheBackground = Color.Default;
break;
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.