add background property to textblock

This commit is contained in:
bluepilledgreat 2024-10-20 02:07:41 +01:00
parent 9cd4d46e37
commit 61f8235a74

View File

@ -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<double>(xmlElement, "FontSize");
if (fontSize is double)
textBlock.FontSize = (double)fontSize;