When we're talking about some kind of design in Xamarin then it's very easy if you're familiar with the styles of Xamarin.
So the question is, what is style?
A style is a property of your control that tells your control how to look in different scenarios. Styles can be used to create the appearance of your controls.
In Xamarin we have different types of styles. If you're a web developer and have know how of CSS (Cascading style sheets) then it’s very easy for you to learn style in Xamarin and xaml.
So let's dive into the depth of styles.
In Xamarin we're going to cover lot of design aspects. So let’s get started.
When someone tells you to create a form or application first page which includes different text boxes and different buttons what are you going to do? Probably you would create different text boxes and buttons and assign style properties in each control. What if someone asks you to add a hundred buttons in your page with the same properties for all buttons? Maybe you would hardly code all the styles in each button tag. This will also work, but the purpose of reusability diminishes and your code size grows. So the question is, what are we going to do?
So here is the solution of this.
We simply add a following code and now write the Label controls simply without setting any property. What you'll need to do is simply add a style reference to call all the properties that you've already defined in your custom styles.
- <ResourceDictionary>
- <Style x:Key="LabelStyle" TargetType="Label">
- <Setter Property="TextColor" Value="Red"/>
- <Setter Property="FontSize" Value="30"/>
- </Style>
- </ResourceDictionary>
- </ContentPage.Resources>
- <StackLayout>
- <Label Text="Check out my style." Style="{StaticResourceLabelStyle}" />
- </StackLayout>
Keep staying with us for different and tricky tips and articles.

Humayun Kabir MamunPosted Mar 5, 2016, 11:06 PM
Nice...
Sonu ChaudharyPosted Mar 5, 2016, 12:20 PM
Nice one
Amit Kumar SinghPosted Mar 4, 2016, 6:49 AM
Good one
Sibeesh VenuPosted Mar 4, 2016, 6:44 AM
Nice Share!. I guess I must start learning Xamarin :). Seems it is pretty interesting.
Shubham KumarPosted Mar 4, 2016, 3:37 AM
nice
Ammar ShaukatPosted Mar 3, 2016, 12:23 PM
Sir can I meet you by face ? I really want to have your company
Vignesh ManiPosted Mar 3, 2016, 12:21 PM
Good
Ammar ShaukatPosted Mar 3, 2016, 12:19 PM
I'm anxiously waiting for your next article . after all I'm your great fan.
Ammar ShaukatPosted Mar 3, 2016, 11:33 AM
can you please upload something about "Making a hello world app in Xamarin "?
Ammar ShaukatPosted Mar 3, 2016, 11:32 AM
so you mean to say this is how we can use CSS like styles for our controls in Xamarin ?
Mohammed IbrahimPosted Mar 3, 2016, 10:36 AM
nice