From 97ff46d3f3a04e316cab3e7f69274e90fa740aca Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:44:26 +0100 Subject: [PATCH] add font properties to control --- Bloxstrap/Resources/CustomBootstrapperSchema.json | 5 ++++- Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Resources/CustomBootstrapperSchema.json b/Bloxstrap/Resources/CustomBootstrapperSchema.json index 3a82e1a..44e5a19 100644 --- a/Bloxstrap/Resources/CustomBootstrapperSchema.json +++ b/Bloxstrap/Resources/CustomBootstrapperSchema.json @@ -27,7 +27,10 @@ "BorderThickness": "Thickness", "Foreground": "Brush", "Background": "Brush", - "BorderBrush": "Brush" + "BorderBrush": "Brush", + "FontSize": "double", + "FontWeight": "FontWeight", + "FontStyle": "FontStyle" } }, "BloxstrapCustomBootstrapper": { diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index 50d6283..e1c4f82 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -610,6 +610,12 @@ namespace Bloxstrap.UI.Elements.Bootstrapper ApplyBrush_UIElement(dialog, uiElement, "Background", Control.BackgroundProperty, xmlElement); ApplyBrush_UIElement(dialog, uiElement, "BorderBrush", Control.BorderBrushProperty, xmlElement); + + var fontSize = ParseXmlAttributeNullable(xmlElement, "FontSize"); + if (fontSize is double) + uiElement.FontSize = (double)fontSize; + uiElement.FontWeight = GetFontWeightFromXElement(xmlElement); + uiElement.FontStyle = GetFontStyleFromXElement(xmlElement); } private static UIElement HandleXmlElement_BloxstrapCustomBootstrapper(CustomDialog dialog, XElement xmlElement)