dont set fontsize if not set

This commit is contained in:
bluepilledgreat 2024-10-20 01:47:17 +01:00
parent 1b44d6454b
commit e136927f18

View File

@ -549,7 +549,9 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
else if (foregroundBrush is string) else if (foregroundBrush is string)
textBlock.SetResourceReference(TextBlock.ForegroundProperty, foregroundBrush); textBlock.SetResourceReference(TextBlock.ForegroundProperty, foregroundBrush);
textBlock.FontSize = ParseXmlAttribute<double>(xmlElement, "FontSize", 12); var fontSize = ParseXmlAttributeNullable<double>(xmlElement, "FontSize");
if (fontSize is double)
textBlock.FontSize = (double)fontSize;
textBlock.FontWeight = GetFontWeightFromXElement(xmlElement); textBlock.FontWeight = GetFontWeightFromXElement(xmlElement);
textBlock.FontStyle = GetFontStyleFromXElement(xmlElement); textBlock.FontStyle = GetFontStyleFromXElement(xmlElement);