add foreground property to control

This commit is contained in:
bluepilledgreat 2024-10-20 02:07:34 +01:00
parent da5144801f
commit 9cd4d46e37

View File

@ -412,11 +412,17 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
if (borderThickness != null)
uiElement.BorderThickness = (Thickness)borderThickness;
object? foregroundBrush = GetBrushFromXElement(xmlElement, "Background");
object? foregroundBrush = GetBrushFromXElement(xmlElement, "Foreground");
if (foregroundBrush is Brush)
uiElement.Background = (Brush)foregroundBrush;
uiElement.Foreground = (Brush)foregroundBrush;
else if (foregroundBrush is string)
uiElement.SetResourceReference(Control.BackgroundProperty, foregroundBrush);
uiElement.SetResourceReference(Control.ForegroundProperty, foregroundBrush);
object? backgroundBrush = GetBrushFromXElement(xmlElement, "Background");
if (backgroundBrush is Brush)
uiElement.Background = (Brush)backgroundBrush;
else if (backgroundBrush is string)
uiElement.SetResourceReference(Control.BackgroundProperty, backgroundBrush);
object? borderBrush = GetBrushFromXElement(xmlElement, "BorderBrush");
if (borderBrush is Brush)