Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Last active January 30, 2018 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/c29fc8c8e124dfbb82c19ac79427cdcb to your computer and use it in GitHub Desktop.
Save juucustodio/c29fc8c8e124dfbb82c19ac79427cdcb to your computer and use it in GitHub Desktop.
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