This allow to mix styles if required.
title.TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f);
title.PixelSize = 48.0f;
title.FontFamily = "BreezeSans";
- title.FontStyle = FontsStyles.Light();
+ title.FontStyle = new PropertyMap().AddLightFontStyle();
View bounding = new View();
bounding.BackgroundImage = NUIApplication.Current.DirectoryInfo.Resource + "Rectangle 861.svg";
title.PointSize = 48.0f;\r
title.HorizontalAlignment = HorizontalAlignment.Center;\r
title.FontFamily = "BreezeSans";\r
- title.FontStyle = FontsStyles.Light();\r
+ title.FontStyle = new PropertyMap().AddLightFontStyle();\r
\r
TextLabel content = new TextLabel();\r
content.Position2D = new Position2D(81, 247);\r
{
public static class FontsStyles
{
- private static PropertyMap light;
+ public static PropertyMap AddLightFontStyle(this PropertyMap propertyMap)
+ {
+ return propertyMap.Add("weight", new PropertyValue("light"));
+ }
- public static PropertyMap Light()
+ public static PropertyMap AddRegularFontStyle(this PropertyMap propertyMap)
{
- if (light == null)
- {
- light = new PropertyMap();
- light.Add("weight", new PropertyValue("light"));
- }
- return light;
+ return propertyMap.Add("weight", new PropertyValue("regular"));
}
- public static PropertyMap Regular()
+ public static PropertyMap AddBoldFontStyle(this PropertyMap propertyMap)
{
- if (light == null)
- {
- light = new PropertyMap();
- light.Add("weight", new PropertyValue("regular"));
- }
- return light;
+ return propertyMap.Add("weight", new PropertyValue("bold"));
}
}
-}
\ No newline at end of file
+}
title.Ellipsis = false;\r
title.PixelSize = 48.0f;\r
title.FontFamily = "BreezeSans";\r
- title.FontStyle = FontsStyles.Light();\r
+ title.FontStyle = new PropertyMap().AddLightFontStyle();\r
\r
var carousel = new CarouselPicker(CarouselPickerStyles.Default);\r
carousel.Position2D = new Position2D(412, 242);\r
title.Ellipsis = false;\r
title.PixelSize = 48.0f;\r
title.FontFamily = "BreezeSans";\r
- title.FontStyle = FontsStyles.Light();\r
+ title.FontStyle = new PropertyMap().AddLightFontStyle();\r
\r
var carousel = new CarouselPicker(CarouselPickerStyles.Default);\r
carousel.Position2D = new Position2D(412, 242);\r