Skip to content

Instantly share code, notes, and snippets.

@juucustodio

juucustodio/App.xaml

Last active Jan 30, 2018
Embed
What would you like to do?
Example of Global Styles in Xamarin.Forms applications - http://julianocustodio.com/global-styles
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DemoTimeLine.App">
<Application.Resources>
<ResourceDictionary>
<!--Colors-->
<Color x:Key="ColorText">#3030E8</Color>
<Color x:Key="ColorButton">#20E82A</Color>
<!--Font Families-->
<OnPlatform x:TypeArguments="x:String" x:Key="RegularFontFamily">
<On Platform="Android">sans-serif</On>
<On Platform="iOS">HelveticaNeue</On>
</OnPlatform>
<OnPlatform x:TypeArguments="x:String" x:Key="MediumFontFamily">
<On Platform="Android">sans-serif-medium</On>
<On Platform="iOS">HelveticaNeue-Medium</On>
</OnPlatform>
<!--Styles-->
<Style x:Key="TitleStyle" TargetType="Label">
<Setter Property="TextColor" Value="{StaticResource ColorText}" />
<Setter Property="Font" Value="{StaticResource MediumFontFamily}" />
</Style>
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="TextColor" Value="{StaticResource ColorText}" />
<Setter Property="Font" Value="{StaticResource RegularFontFamily}" />
<Setter Property="BackgroundColor" Value="{StaticResource ColorButton}"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.