Skip to content

Restyling Through Code

Roman Shapiro edited this page Jul 14, 2018 · 9 revisions

Restyling through code is quote easy. There's a static object Stylesheet.Current that contains all default widget styles.
I.e. following code will make all TextBlocks - created with empty constructor - green and using smaller font:

  Stylesheet.Current.TextBlockStyle.TextColor = Color.Green;
  Stylesheet.Current.TextBlockStyle.Font = DefaultAssets.FontSmall;

Note. The default style is being applied to the widget in the moment of the creation. Therefore all changes to Stylesheet.Current should be done before the UI is created.