How to apply custom themes which automatically set the text color according to the themes which I applied ?
You need to do that separately for each platform.
For windows there are other settings similar to this: ((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = Color.FromArgb(0xFF, 0, 127, 100);
((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = Color.FromArgb(0xFF, 0, 127, 100);
For android you need to create Styles in XML in Resources folder and then use them
@DushyantBangal : have u any link or sample app code from where I can understand it more correctly ?
@AmitTest , you need to have basic idea of how its done in Native. I was going to post how i did it on one of my projects but they're not allowing to post XML code here. Can you post this question on stackoverflow, and post the link here?
However, if you're talking about styles, have a look at this:https://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/styles/
But I still suggest you use themes too. Because you dont want to set TextColor to Black everytime, rather just set the application to a light Theme.
eg. By default, the Android app has dark theme. So if you set BackgroundColor to Black, your Labels wont show. You can create a style which sets the Label font to black, but using a Light theme is a proper way to go.
@DushyantBangal : http://stackoverflow.com/questions/33251593/how-to-create-theme-in-xamarin-forms
Can we do this using CSS ?
@AmitTest Not as far as I know
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies