From 61f8235a742070ecd442befb356dcb2aea54bffa Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sun, 20 Oct 2024 02:07:41 +0100 Subject: [PATCH] add background property to textblock --- Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index 57f2042..359ce19 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -555,6 +555,12 @@ namespace Bloxstrap.UI.Elements.Bootstrapper else if (foregroundBrush is string) textBlock.SetResourceReference(TextBlock.ForegroundProperty, foregroundBrush); + object? backgroundBrush = GetBrushFromXElement(xmlElement, "Background"); + if (backgroundBrush is Brush) + textBlock.Foreground = (Brush)backgroundBrush; + else if (backgroundBrush is string) + textBlock.SetResourceReference(TextBlock.BackgroundProperty, backgroundBrush); + var fontSize = ParseXmlAttributeNullable(xmlElement, "FontSize"); if (fontSize is double) textBlock.FontSize = (double)fontSize;