Discover the basic concepts of styles in Xamarin.Forms development and the different scopes where they can apply.
- [Instructor] In Xaml Development, including Xamarin Form Development, the concept of styles is available, specifically to easily manage and apply properties and settings to visual elements. And the concept is that the styles exist at various levels. So a style could exist at the global level, in you app.xaml file, they could exist in a specific page, in the resources for that page. Or a style can exist even at the scope of a control itself. The main concept is that styles are going to set properties and these are going to be cumulative.
So out of the box, a given element is going to have a default style. We'll say that a border or a button has specific properties already set as the default. And then the style will essentially override the default values of every property and be cumulative. The great thing is that after a style is applied, just as with CSS in HTML development, these can easily be overridden on a case by case basis. So again, the concept is that styles can exist at any level and they can easily be overridden and managed for specific cases.
Share this video
Embed this video
Video: Style concepts