I have read the doc and I can't get the global styles to work in my Xamarin.Forms 1.3.1 sample app. I can get the page based styles and built in styles work but not the global. Am I doing something wrong? Probably.
Thanks for your help in advance. Adam
using System;
using Xamarin.Forms;
namespace StyleTest
{
public class App : Application
{
public App ()
{
Application.Current.Resources = new ResourceDictionary ();
var labelStyle = new Style (typeof(Label)) {
Setters = {
new Setter { Property = Label.TextColorProperty, Value = Color.Green }
}
};
Application.Current.Resources.Add ("labelStyle", labelStyle);
MainPage = new ContentPage {
Content = new StackLayout {
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
StyleId = "labelStyle",
XAlign = TextAlignment.Center,
Text = "Welcome to Xamarin Forms!"
}
}
}
};
}
}
}