I'm playing around with styling in Xamarin.Forms and have a question about the order/rules in which styles are applied. I'm looking for some sort of reference on how this works, but haven't found much other than general "how to style [pick your whatever]" type of posts.
Specifically, I have these two projects:
MyProject.Shared
MyProject.Android
The shared project has my App.xaml and main views/viewmodels, etc.
There's multiple places where I can apply styles:
- App.xaml resource dictionary
- MainPage.xaml "inline" (in the xaml elements themselves, not using local resources)
- MyProject.Android\Resources
- Custom Renderers (I haven't explored these fully yet)
Precedence between the Application Resources and a given View's Resources seem straightforward enough, but how are the styles between an Android app (or iOS/Win) resolved in comparison with the shared library styles?
Some styles I set seem to be overridden by the android styles, but others seems to ignore android styles and apply the shared styles. Sometimes setting style properties directly via inline xaml doesn't act the way I'd expect, and sometimes with the app level resource styles, only a few settings in the style "take."
Is there some definitive documentation on the order of precedence for these various methods of setting styles, or some formal guidelines that should be followed to properly theme an app?