Skip to content

Instantly share code, notes, and snippets.

@davidortinau
Created June 15, 2017 02: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 davidortinau/18a6a052ee9684e9f76074432fca95df to your computer and use it in GitHub Desktop.
Save davidortinau/18a6a052ee9684e9f76074432fca95df to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="My.Project.Styles">
<Style TargetType="Label">
<Setter Property="TextColor" Value="Blue" />
</Style>
...
</ResourceDictionary>
using My.Project.Styles;
...
if (App.Current.Resources == null)
App.Current.Resources = new ResourceDictionary();
App.Current.Resources.MergedWith = typeof(MyXamlStyles);
<Application ... xmlns:myTheme="clr-namespace:My.Project.Styles">
<Application.Resources>
<ResourceDictionary MergedWith="myTheme:MyXamlStyles" />
</Application.Resources>
...
</Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment