public void StyleSheetsOnAppAreApplied() { var app = new MockApplication(); app.Resources.Add(StyleSheet.FromString("label{ color: red;}")); var page = new ContentPage { Content = new Label() }; app.LoadPage(page); Assert.That((page.Content as Label).TextColor, Is.EqualTo(Colors.Red)); }
public void StyleSheetsOnAppAreAppliedBeforePageStyleSheet() { var app = new MockApplication(); app.Resources.Add(StyleSheet.FromString("label{ color: white; background-color: blue; }")); var page = new ContentPage { Content = new Label() }; page.Resources.Add(StyleSheet.FromString("label{ color: red; }")); app.LoadPage(page); Assert.That((page.Content as Label).TextColor, Is.EqualTo(Colors.Red)); Assert.That((page.Content as Label).BackgroundColor, Is.EqualTo(Colors.Blue)); }
public void StyleSheetsOnSubviewAreAppliedBeforePageStyleSheet() { var app = new MockApplication(); app.Resources.Add(StyleSheet.FromString("label{ color: white; }")); var label = new Label(); label.Resources.Add(StyleSheet.FromString("label{color: yellow;}")); var page = new ContentPage { Content = label }; page.Resources.Add(StyleSheet.FromString("label{ color: red; }")); app.LoadPage(page); Assert.That((page.Content as Label).TextColor, Is.EqualTo(Colors.Yellow)); }